From: Mikko Rasa Date: Fri, 10 Apr 2015 18:08:22 +0000 (+0300) Subject: Set event types on Windows if connect finished immediately X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=49fbad8c6fbe8c54c9b2dafff48eb14d36a5aa74;p=libs%2Fnet.git Set event types on Windows if connect finished immediately --- diff --git a/source/net/streamsocket.cpp b/source/net/streamsocket.cpp index 1dab2e3..85f2b00 100644 --- a/source/net/streamsocket.cpp +++ b/source/net/streamsocket.cpp @@ -73,6 +73,9 @@ bool StreamSocket::connect(const SockAddr &addr) if(err==0) { connected = true; +#ifdef WIN32 + WSAEventSelect(priv->handle, *priv->event, FD_READ|FD_CLOSE); +#endif set_events(IO::P_INPUT); signal_connect_finished.emit(0); }