This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, xy.zzy
Date 2011-10-06.14:29:08
SpamBayes Score 0.001611306
Marked as misclassified No
Message-id <1317911350.21.0.879184331142.issue13109@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-10-06 14:29:10eric.smithsetrecipients: + eric.smith, xy.zzy
2011-10-06 14:29:10eric.smithsetmessageid: <1317911350.21.0.879184331142.issue13109@psf.upfronthosting.co.za>
2011-10-06 14:29:09eric.smithlinkissue13109 messages
2011-10-06 14:29:09eric.smithcreate