Ticket #5285 defect closed duplicate
win32eventreactor misses disconnect events that happen too soon
|Reported by:||exarkun||Owned by:|
If a client connects to a win32er tcp server and then disconnects very quickly (say, before win32er handles the connect event), then the disconnect event is never noticed or handled. The socket remains open and apparently connected indefinitely.
This may also require that the client send some data before it disconnects, I'm not sure.
Attached is a pair of client/server programs which will demonstrate this problem. If you run the server and then point the client at it, you should expect to see three messages in the server output. One announcing connection made, one announcing the arrival of the "x" byte, and one announcing the loss of the connection. Instead, only the first two messages will (almost always) appear. Only when the server is killed will the disconnect messages appear.