Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/monitor poll #414

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,15 @@ class monitor_t
_socket = socket_ref();
}
#endif

void close() ZMQ_NOTHROW
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a test for this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be done.

{
#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_)
{
Expand Down Expand Up @@ -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)
Expand Down