X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstreamsocket.cpp;fp=source%2Fstreamsocket.cpp;h=9147ad88861f02cfb4f01502b8df40fde3633698;hb=823208d633b0c7352e436513990ecf81d9e67fd4;hp=b06cf69ca9314cb6c750c1147513f9b4dc9c3a0a;hpb=6489612c788dd57721fc181ff26a981b35668d1e;p=libs%2Fnet.git 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;