On 2008-03-28, Laszlo Nagy <[EMAIL PROTECTED]> wrote:
>> while (1):
>> buffer = sock.recv(1024)
>> if not buffer:
>> dodiscon()
>>
>
> sock.recv(1024) can return zero bytes of data indicating that no data
> arrived yet.
No, it can't.
> It does not mean that you have been disconnected.
Yes, that is exactly what it means.
>From the recv() man page:
RETURN VALUE
These calls return the number of bytes received, or -1 if an error
occurred. The return value will be 0 when the peer has performed an
orderly shutdown.
--
Grant
--
http://mail.python.org/mailman/listinfo/python-list