X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fstreamsocket.cpp;h=85f2b00a05d33e7820a022f6bb0e83716d0829f5;hb=49fbad8c6fbe8c54c9b2dafff48eb14d36a5aa74;hp=8a262454eca173dfcc6ef93f0fcd0d45c10582f7;hpb=50e9f9ea7f7385a2c5931fca2b8fb1103078e67c;p=libs%2Fnet.git diff --git a/source/net/streamsocket.cpp b/source/net/streamsocket.cpp index 8a26245..85f2b00 100644 --- a/source/net/streamsocket.cpp +++ b/source/net/streamsocket.cpp @@ -1,4 +1,6 @@ -#ifndef WIN32 +#ifdef WIN32 +#include +#else #include #endif #include @@ -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); } @@ -90,7 +95,7 @@ bool StreamSocket::poll_connect(const Time::TimeDelta &timeout) int err; socklen_t len = sizeof(int); - get_option(SOL_SOCKET, SO_ERROR, &err, &len); + priv->get_option(SOL_SOCKET, SO_ERROR, &err, &len); if(err!=0) { @@ -119,7 +124,7 @@ void StreamSocket::on_event(IO::PollEvent ev) { int err; socklen_t len = sizeof(err); - get_option(SOL_SOCKET, SO_ERROR, &err, &len); + priv->get_option(SOL_SOCKET, SO_ERROR, &err, &len); connecting = false; connected = (err==0);