By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,706 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,706 IT Pros & Developers. It's quick & easy.

Python Socket programming

P: n/a
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/
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies

P: n/a
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

Jun 27 '08 #2

P: n/a
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
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.