keep _monitor_socket as private member

This commit is contained in:
Stefan Dietel 2023-08-25 16:26:41 +02:00
parent 2dcab86425
commit d8ab66a7af
2 changed files with 3 additions and 2 deletions

View File

@ -172,7 +172,7 @@ TEST_CASE("poll monitor events using active poller", "[monitor]")
void addToPoller(zmq::active_poller_t &inActivePoller) void addToPoller(zmq::active_poller_t &inActivePoller)
{ {
inActivePoller.add( inActivePoller.add(
_monitor_socket, zmq::event_flags::pollin, monitor_socket(), zmq::event_flags::pollin,
[&](zmq::event_flags ef) { process_event(static_cast<short>(ef)); }); [&](zmq::event_flags ef) { process_event(static_cast<short>(ef)); });
} }

View File

@ -2589,13 +2589,14 @@ class monitor_t
return true; return true;
} }
socket_t _monitor_socket; socket_ref monitor_socket() {return _monitor_socket;}
private: private:
monitor_t(const monitor_t &) ZMQ_DELETED_FUNCTION; monitor_t(const monitor_t &) ZMQ_DELETED_FUNCTION;
void operator=(const monitor_t &) ZMQ_DELETED_FUNCTION; void operator=(const monitor_t &) ZMQ_DELETED_FUNCTION;
socket_ref _socket; socket_ref _socket;
socket_t _monitor_socket;
void close() ZMQ_NOTHROW void close() ZMQ_NOTHROW
{ {