Python Socket programming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • srinivasan srinivas

    Python Socket programming

    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/
  • Dan Stromberg

    #2
    Re: Python Socket programming

    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.dnsal ias.org/~strombrg/bufsock.html

    Comment

    • William McBrine

      #3
      Re: Python Socket programming

      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

      Comment

      Working...