search for: sock_timeout

Displaying 1 result from an estimated 1 matches for "sock_timeout".

Did you mean: lock_timeout
2009 Jul 06
1
Nonblocking connect is not proprly checked in poll implementation
...g copy) @@ -516,17 +516,27 @@ int sock_connected (sock_t sock, int timeout) { struct pollfd check; + int val = SOCK_ERROR; + socklen_t size = sizeof val; check.fd = sock; check.events = POLLOUT; switch (poll (&check, 1, timeout*1000)) { case 0: return SOCK_TIMEOUT; + default: + /* on windows getsockopt.val is defined as char* */ + if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*) &val, &size) == 0) + { + if (val == 0) + return 1; + sock_set_error (val); +...