mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-13 10:52:57 +01:00
monitor: expose close() method to public
This commit is contained in:
parent
3aa80d028c
commit
c2298e8dd4
16
zmq.hpp
16
zmq.hpp
@ -2414,6 +2414,15 @@ class monitor_t
|
||||
_socket = socket_ref();
|
||||
}
|
||||
#endif
|
||||
|
||||
void close() ZMQ_NOTHROW
|
||||
{
|
||||
#ifdef ZMQ_EVENT_MONITOR_STOPPED
|
||||
abort();
|
||||
#endif
|
||||
_monitor_socket = socket_t();
|
||||
}
|
||||
|
||||
virtual void on_monitor_started() {}
|
||||
virtual void on_event_connected(const zmq_event_t &event_, const char *addr_)
|
||||
{
|
||||
@ -2518,13 +2527,6 @@ class monitor_t
|
||||
|
||||
socket_ref _socket;
|
||||
socket_t _monitor_socket;
|
||||
|
||||
void close() ZMQ_NOTHROW
|
||||
{
|
||||
if (_socket)
|
||||
zmq_socket_monitor(_socket.handle(), ZMQ_NULLPTR, 0);
|
||||
_monitor_socket.close();
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER)
|
||||
|
Loading…
Reference in New Issue
Block a user