Eric V. Smith <e...@trueblade.com> added the comment:

Assuming that you're unplugging the cable when the code is in the loop that 
occurs after the line "self.pcPart.write(cmdx)", and also assuming that you 
haven't turned on keepalives, then the behavior you see is expected.

You're just waiting to read some data, and there are no pending writes. 
Therefore the TCP stack will wait forever if there are no incoming packets. 
There could be no incoming packets due to no data being ready, of from the 
network being down. The TCP stack has no way of knowing, so it cannot notify 
your code.

I suggest turning on TCP keepalives, which would then allow the TCP stack to 
notify your code that the connection has been closed.

I'm going to close this issue. If you turn on keepalives and still see this 
problem, please reopen it.

----------
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13109>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to