From: Mikko Rasa Date: Sat, 6 Aug 2011 20:32:26 +0000 (+0300) Subject: Correct poll usage X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=823208d633b0c7352e436513990ecf81d9e67fd4;p=libs%2Fnet.git Correct poll usage --- diff --git a/source/streamsocket.cpp b/source/streamsocket.cpp index b06cf69..9147ad8 100644 --- a/source/streamsocket.cpp +++ b/source/streamsocket.cpp @@ -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;