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

add functions for removing and modifying file descriptors to poller_t #607

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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: 16 additions & 0 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2681,6 +2681,13 @@ template<typename T = no_user_data> class poller_t
}
}

void remove(fd_t fd)
{
if (0 != zmq_poller_remove_fd(poller_ptr.get(), fd)) {
throw error_t{};
}
}

void modify(zmq::socket_ref socket, event_flags events)
{
if (0
Expand All @@ -2690,6 +2697,15 @@ template<typename T = no_user_data> class poller_t
}
}

void modify(fd_t fd, event_flags events)
{
if (0
!= zmq_poller_modify_fd(poller_ptr.get(), fd,
static_cast<short>(events))) {
throw error_t{};
}
}

size_t wait_all(std::vector<event_type> &poller_events,
const std::chrono::milliseconds timeout)
{
Expand Down
Loading