Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python Socket programming

Reply
Thread Tools

Python Socket programming

 
 
srinivasan srinivas
Guest
Posts: n/a
 
      06-13-2008
Hi,
I am going to do some socket related programming in Python. Before that, I wish to know the Gotchas of Python Scoket Programming.
Can anyone send me any link that satisfies my needs??
Thanks,
Srini


Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/
 
Reply With Quote
 
 
 
 
Dan Stromberg
Guest
Posts: n/a
 
      06-13-2008
On Fri, 13 Jun 2008 21:59:06 +0530, srinivasan srinivas wrote:

> Hi,
> I am going to do some socket related programming in Python. Before that,
> I wish to know the Gotchas of Python Scoket Programming. Can anyone send
> me any link that satisfies my needs?? Thanks,
> Srini
>
>
> Explore your hobbies and interests. Go to
> http://in.promos.yahoo.com/groups/


IMO, there aren't many.

Some methods require a tuple where you might think they shouldn't need
one.

And you have to be careful not to make assumptions about, say, writing n
bytes in your server and reading n bytes in the client - you may not get
all n right away. TCP is free to split or aggregate your chunks as it
sees fit. So you need some sort of record terminator or something,
rather than assuming transfer sizes will be preserved by TCP. Often they
will be preserved, but they aren't guaranteed to be. But this is true of
just about any language with a socket interface.

For the latter issue (the chunk size thing), I put together http://
stromberg.dnsalias.org/~strombrg/bufsock.html

 
Reply With Quote
 
 
 
 
William McBrine
Guest
Posts: n/a
 
      06-14-2008
On Fri, 13 Jun 2008 21:59:06 +0530, srinivasan srinivas wrote:

> I am going to do some socket related programming in Python. Before that,
> I wish to know the Gotchas of Python Scoket Programming.


The only gotcha I see is that you won't want to go back to doing it in C.

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 1 02-03-2009 06:20 AM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 0 02-01-2009 12:45 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM



Advertisments