windows error handling improved

This commit is contained in:
unknown
2009-10-01 13:48:04 +02:00
parent cc631c4c66
commit 49a9ef5fcb
6 changed files with 79 additions and 12 deletions

View File

@@ -50,8 +50,10 @@ int zmq::tcp_connecter_t::open ()
// Create the socket.
s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
// TODO: Convert error to errno.
wsa_assert (s != INVALID_SOCKET);
if (s == INVALID_SOCKET) {
wsa_error_to_errno ();
return -1;
}
// Set to non-blocking mode.
unsigned long argp = 1;
@@ -78,9 +80,7 @@ int zmq::tcp_connecter_t::open ()
return -1;
}
// TODO: Convert error to errno.
wsa_assert (rc == 0);
wsa_error_to_errno ();
return -1;
}