On 26/08/2013 20:45, Paul Pittlerson wrote:
I'm currently learning about the socket module. My question is how
can I detect if a connection is closed from the other side, for
example a KeyboardInterrupt as I frequently use. My code below:

[snip]
When reading from a socket, it'll return as much data as is available,
up to the given limit if specified.

If _no_ data is available, then it'll block, unless the socket has been
closed at the other end, in which case it'll return zero bytes (an
empty bytestring).
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to