mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-16 07:23:46 +02:00
Be more conservative about when to generate ZMQ_EVENT_CLOSE_FAILED
This also fixes a bug in tcp_connecter and tcp_listener, which generated the event not when they failed to close the socket but when the succeed to close it.
This commit is contained in:
@@ -298,13 +298,9 @@ void zmq::tcp_connecter_t::close ()
|
||||
zmq_assert (s != retired_fd);
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
int rc = closesocket (s);
|
||||
if (unlikely (rc != SOCKET_ERROR))
|
||||
session->monitor_event (ZMQ_EVENT_CLOSE_FAILED, endpoint.c_str(), zmq_errno());
|
||||
wsa_assert (rc != SOCKET_ERROR);
|
||||
#else
|
||||
int rc = ::close (s);
|
||||
if (unlikely (rc == 0))
|
||||
session->monitor_event (ZMQ_EVENT_CLOSE_FAILED, endpoint.c_str(), zmq_errno());
|
||||
errno_assert (rc == 0);
|
||||
#endif
|
||||
session->monitor_event (ZMQ_EVENT_CLOSED, endpoint.c_str(), s);
|
||||
|
Reference in New Issue
Block a user