Python Socket programming

Discussion in 'Python' started by srinivasan srinivas, Jun 13, 2008.

  1. 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/
     
    srinivasan srinivas, Jun 13, 2008
    #1
    1. Advertising

  2. 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
     
    Dan Stromberg, Jun 13, 2008
    #2
    1. Advertising

  3. 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
     
    William McBrine, Jun 14, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laszlo Nagy
    Replies:
    1
    Views:
    4,874
    Mark Wooding
    Jan 27, 2009
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    979
    Jean-Paul Calderone
    Jan 27, 2009
  3. Laszlo Nagy
    Replies:
    0
    Views:
    557
    Laszlo Nagy
    Feb 1, 2009
  4. Steve Holden
    Replies:
    0
    Views:
    674
    Steve Holden
    Feb 1, 2009
  5. Steve Holden
    Replies:
    1
    Views:
    727
Loading...

Share This Page