Skip to content

Commit

Permalink
add functions for removing and modifying file descriptors to poller_t
Browse files Browse the repository at this point in the history
  • Loading branch information
uyha committed Jul 19, 2023
1 parent c94c207 commit 6b700cf
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit 6b700cf

Please sign in to comment.