[Python-Dev] noreply@sourceforge.net: [Python-bugs-list] [Bug #111620] lots of use of send() without verifyi ng amount of d

Gordon McMillan gmcm@hypernet.com
Fri, 11 Aug 2000 13:04:26 -0400


[I wrote, about send()]
> Yes, it returns the number of bytes sent. For TCP/IP it is *not*
> an error to send less than the argument. It's only an error if
> the other end dies at the time of actual send.

[and...]
> Just open a TCP/IP connection and send huge (64K or so) 
> buffers. Current Python behavior is no different than C on 
> Linux, HPUX and Windows.

And I just demonstrated it. Strangely enough, sending from Windows 
(where the dos say "send returns the total number of bytes sent, 
which can be less than the number indicated by len") it always 
sent the whole buffer, even when that was 1M on a non-
blocking socket. (I select()'ed the socket first, to make sure it 
could send something).

But from Linux, the largest buffer sent was 54,020 and typical 
was 27,740. No errors.


- Gordon