mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
Merge pull request #753 from pijyoi/master
handle bind error in make_fdpair() win32 codepath
This commit is contained in:
commit
e3ddda7a1f
@ -348,7 +348,15 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
|
||||
addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
|
||||
addr.sin_port = htons (signaler_port);
|
||||
rc = bind (listener, (const struct sockaddr*) &addr, sizeof (addr));
|
||||
wsa_assert (rc != SOCKET_ERROR);
|
||||
if (rc == SOCKET_ERROR) {
|
||||
int saved_errno = WSAGetLastError ();
|
||||
closesocket (listener);
|
||||
SetEvent (sync);
|
||||
CloseHandle (sync);
|
||||
// Set errno from saved value
|
||||
errno = wsa_error_to_errno (saved_errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Listen for incomming connections.
|
||||
rc = listen (listener, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user