http://bugs.winehq.org/show_bug.cgi?id=58526
--- Comment #15 from Zeb Figura z.figura12@gmail.com --- (In reply to Zeb Figura from comment #13)
Okay, yeah, it has nothing to do with completion ports per se, it's that when the remote end of a socket is closed, recv() should terminate with an error, but we're terminating with success. I'm kind of baffled that this is neither tested nor has ever come up before.
No, I was right to be baffled. I can't find if we tested it before, but terminating asyncs with success is the right thing to do.
There is actually a RST coming over the pipe here.
It turns out that native will trigger RST under certain conditions that we don't, including:
* WSACleanup() * orderly process termination without closing the socket * TerminateProcess()
but not:
* closesocket() * CloseHandle()
That's kind of baffling, because I have no idea how the NT driver is supposed to be able to tell. It's not really a problem for us, we can communicate through side channels, but it's weird.