socket and exception

Jerome Chan jchan at maxvu.com
Thu Mar 9 18:53:14 EST 2000


Okay

I'm using a select with a non blocking sock_stream tcp socket. And I'm
sending data. The other side suddenly closes its socket. How do I determine
that the socket is closed? I get an exception (which is different for each
os). But I also get an exception when the outgoing buffer is full, in the
case that the other socket is processing too slowly or is swapping memory or
some other event. Is there a portable way of distinguishing between the two
exceptions? In the first case I need to close up the connection while in the
second case I can try a resend at a later time.





More information about the Python-list mailing list