]> git.tdb.fi Git - libs/net.git/commitdiff
Correct poll usage
authorMikko Rasa <tdb@tdb.fi>
Sat, 6 Aug 2011 20:32:26 +0000 (23:32 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 6 Aug 2011 20:38:48 +0000 (23:38 +0300)
source/streamsocket.cpp

index b06cf69ca9314cb6c750c1147513f9b4dc9c3a0a..9147ad88861f02cfb4f01502b8df40fde3633698 100644 (file)
@@ -84,14 +84,8 @@ bool StreamSocket::poll_connect(const Time::TimeDelta &timeout)
        if(!connecting)
                throw bad_socket_state("not connecting");
 
-       int res = poll(*this, IO::P_OUTPUT, timeout);
-       if(res==-1)
-#ifdef WIN32
-               throw system_error("poll", WSAGetLastError());
-#else
-               throw system_error("poll");
-#endif
-       else if(res>0)
+       IO::PollEvent res = poll(*this, IO::P_OUTPUT, timeout);
+       if(res&IO::P_OUTPUT)
        {
                connecting = false;