]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/streamsocket.cpp
Implement an asynchronous name resolver class
[libs/net.git] / source / net / streamsocket.cpp
index 3da0cc312ff640511f4a525c06ed7d6808f24888..85f2b00a05d33e7820a022f6bb0e83716d0829f5 100644 (file)
@@ -1,4 +1,6 @@
-#ifndef WIN32
+#ifdef WIN32
+#include <winsock2.h>
+#else
 #include <sys/socket.h>
 #endif
 #include <cerrno>
@@ -71,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);
        }