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

Thomas Wouters thomas@xs4all.net
Fri, 11 Aug 2000 19:04:37 +0200


On Fri, Aug 11, 2000 at 09:59:07AM -0700, Sam Rushing wrote:

> It's a feature of Linux... it will send() everything.  Other unixen
> act in the classic fashion (it bit me on FreeBSD), and send only what
> fits right into the buffer that awaits.

Ahhh, the downsides of working on the Most Perfect OS (writing this while
our Technical Manager, a FreeBSD fan, is looking over my shoulder ;)
Thanx for clearing that up. I was slowly going insane ;-P

> I think this could safely be added to the send method in
> socketmodule.c.  Linux users wouldn't even notice.  IMHO this is the
> kind of feature that people come to expect from programming in a HLL.
> Maybe disable the feature if it's a non-blocking socket?

Hm, I'm not sure if that's the 'right' thing to do, though disabling it for
non-blocking sockets is a nice idea. It shouldn't break anything, but it
doesn't feel too 'right'. The safe option would be to add a function that
resends as long as necessary, and point everyone to that function. But I'm
not sure what the name should be -- send is just so obvious ;-) 

Perhaps you're right, perhaps we should consider this a job for the type of
VHLL that Python is, and provide the opposite function separate instead: a
non-resending send(), for those that really want it. But in the eyes of the
Python programmer, socket.send() would just magically accept and send any
message size you care to give it, so it shouldn't break things. I think ;)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!