Buffer size when receiving data through a socket?

John Salerno johnjsal at gmailNOSPAM.com
Sat Jun 21 23:54:05 EDT 2008


Dennis Lee Bieber wrote:
> On Wed, 18 Jun 2008 09:56:29 -0400, "John Salerno"
> <johnjsal at NOSPAMgmail.com> declaimed the following in comp.lang.python:
> 
>> Interesting point. I'm not sure if it works that way though. I *think* I 
>> tried sending an empty string from the server back to the client, and as 
>> expected it exited the loop and closed the client, which doesn't make sense 
>> to me, since an empty string could be perfectly valid return data.
>>
> 	Okay... I suppose socket could consider a transmission with 0 data
> bytes as valid "data". The main key is that there had to be send of 0
> data -- opposed to just not receiving anything..

No, I think you're right. I read elsewhere that when I send() call 
returns 0 bytes, the connection is automatically closed.



More information about the Python-list mailing list