Implement WinAPIEventDriverSockets.cancelConnectStream.

This commit is contained in:
Sönke Ludwig 2017-11-12 14:41:08 +01:00
parent 784d4360d5
commit 0897b1bc9e

View file

@ -84,7 +84,15 @@ final class WinAPIEventDriverSockets : EventDriverSockets {
final override void cancelConnectStream(StreamSocketFD sock) final override void cancelConnectStream(StreamSocketFD sock)
{ {
assert(false, "Not implemented"); assert(sock != StreamSocketFD.invalid, "Invalid socket descriptor");
with (m_sockets[sock].streamSocket) {
assert(state == ConnectionState.connecting,
"Must be in 'connecting' state when calling cancelConnection.");
clearSocketSlot(sock);
() @trusted { closesocket(sock); } ();
}
} }
override StreamSocketFD adoptStream(int socket) override StreamSocketFD adoptStream(int socket)