[issue10644] socket loses data, calling send()/sendall() on invalid socket does not report error and returns all bytes as written

Charles-Francois Natali report at bugs.python.org
Wed Dec 8 19:51:56 CET 2010


Charles-Francois Natali <neologix at free.fr> added the comment:

>  it may be very convenient and the performance overhead may be barely noticeable.

Convenient for what ?
If the remote end doesn't send a FIN or RST packet, then the TCP/IP stack has no way of knowing the remote end is down.
Successfull return of send(2) never meant a succesfull delivery to the other end, see man page :
"No indication of failure to deliver is implicit in a send(). Locally detected errors are indicated by a return value of -1. "

If your remote application doesn't close its socket cleanly, then your application is broken.
To guard against that, you could use TCP keepalive...

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10644>
_______________________________________


More information about the Python-bugs-list mailing list