From 823208d633b0c7352e436513990ecf81d9e67fd4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 6 Aug 2011 23:32:26 +0300 Subject: [PATCH] Correct poll usage --- source/streamsocket.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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; -- 2.43.0