and socket.setblocking

Scott David Daniels Scott.Daniels at Acm.Org
Wed Dec 31 20:12:40 CET 2008

Jean-Paul Calderone wrote:
> ...
> On a LAN, it's likely that you'll generally get the exact number of bytes
> which the sender passed to one call of send (until the sender starts to
> pass really huge strings to send, then it'll get split up) just because
> the network has lots of capacity compared to the traffic you're putting
> on it.  However, even on a LAN it's not guaranteed, and on the internet,
> it's extremely likely that this won't happen most of the time.

I don't mean to rebut your point here,rather to "pile on" with a bit
more information.

One point I haven't seen mentioned in this discussion is that nodes in
the internet that carry the TCP/IP traffic are allowed to, for their own
purposes, break large packets up into several smaller packets, and
combine several smaller packets into a single larger packet.  So, no
matter how your TCP/IP packets leave your machine, there is no guarantee
they will reach the destination in the same clumps.  It is the stream,
and not the packets, that is provided by TCP/IP.

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-list mailing list