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;