X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstreamsocket.cpp;h=ed506d6320881c4a4169b54d836da483538510ec;hb=18fd377f86b47234d1598524092167a5930b3e3b;hp=b06cf69ca9314cb6c750c1147513f9b4dc9c3a0a;hpb=6489612c788dd57721fc181ff26a981b35668d1e;p=libs%2Fnet.git diff --git a/source/streamsocket.cpp b/source/streamsocket.cpp index b06cf69..ed506d6 100644 --- a/source/streamsocket.cpp +++ b/source/streamsocket.cpp @@ -82,16 +82,10 @@ bool StreamSocket::connect(const SockAddr &addr) bool StreamSocket::poll_connect(const Time::TimeDelta &timeout) { if(!connecting) - throw bad_socket_state("not connecting"); + return false; - 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;