mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-04 04:55:27 +08:00
VMCI family does not support non-blocking sockets.
It may even cause BSOD on Windows.
This commit is contained in:
parent
184840cf37
commit
73e360fc49
@ -163,15 +163,6 @@ void zmq::vmci_connecter_t::start_connecting ()
|
|||||||
out_event ();
|
out_event ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connection establishment may be delayed. Poll for its completion.
|
|
||||||
else
|
|
||||||
if (rc == -1 && errno == EINPROGRESS) {
|
|
||||||
handle = add_fd (s);
|
|
||||||
handle_valid = true;
|
|
||||||
set_pollout (handle);
|
|
||||||
socket->event_connect_delayed (endpoint, zmq_errno());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle any other error condition by eventual reconnect.
|
// Handle any other error condition by eventual reconnect.
|
||||||
else {
|
else {
|
||||||
if (s != retired_fd)
|
if (s != retired_fd)
|
||||||
@ -228,9 +219,6 @@ int zmq::vmci_connecter_t::open ()
|
|||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set the non-blocking flag.
|
|
||||||
unblock_socket (s);
|
|
||||||
|
|
||||||
// Connect to the remote peer.
|
// Connect to the remote peer.
|
||||||
int rc = ::connect (
|
int rc = ::connect (
|
||||||
s, addr->resolved.vmci_addr->addr (),
|
s, addr->resolved.vmci_addr->addr (),
|
||||||
@ -240,19 +228,6 @@ int zmq::vmci_connecter_t::open ()
|
|||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Translate error codes indicating asynchronous connect has been
|
|
||||||
// launched to a uniform EINPROGRESS.
|
|
||||||
#ifdef ZMQ_HAVE_WINDOWS
|
|
||||||
const int error_code = WSAGetLastError();
|
|
||||||
if (error_code == WSAEINPROGRESS || error_code == WSAEWOULDBLOCK)
|
|
||||||
errno = EINPROGRESS;
|
|
||||||
else
|
|
||||||
errno = wsa_error_to_errno(error_code);
|
|
||||||
#else
|
|
||||||
if (errno == EINTR)
|
|
||||||
errno = EINPROGRESS;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Forward the error.
|
// Forward the error.
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user