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:
Martin Hurton
2012-07-11 17:59:22 +02:00
parent 6ac5cf8697
commit c84ca01e95
4 changed files with 2 additions and 16 deletions

View File

@@ -224,10 +224,7 @@ int zmq::ipc_connecter_t::close ()
{
zmq_assert (s != retired_fd);
int rc = ::close (s);
if (rc != 0) {
session->monitor_event (ZMQ_EVENT_CLOSE_FAILED, endpoint.c_str(), zmq_errno());
return -1;
}
errno_assert (rc == 0);
session->monitor_event (ZMQ_EVENT_CLOSED, endpoint.c_str(), s);
s = retired_fd;
return 0;