[issue5661] asyncore should catch EPIPE while sending() and receiving()
report at bugs.python.org
Thu Oct 27 19:58:17 CEST 2011
Charles-François Natali <neologix at free.fr> added the comment:
Did you try with the current branches?
AFAICT, this should have been solved by 208a5290fd38 (issue #11265), and I did a quick test with default and it seems to be fixed.
In any case, it's probably a good idea to add this test to test_asyncore.
> So it seems that, on linux, when writing to a closed socket, you get
> an ECONNRESET when there is still data in the socket, and an EPIPE
> otherwise. In the first case the tcp connection ends with a single
> RESET, and in the second case it ends with the sequence FIN-ACK-RESET.
Yes, see RFC1122 section 22.214.171.124:
A host MAY implement a "half-duplex" TCP close sequence, so
that an application that has called CLOSE cannot continue to
read data from the connection. If such a host issues a
CLOSE call while received data is still pending in TCP, or
if new data is received after CLOSE is called, its TCP
SHOULD send a RST to show that data was lost.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list