Commit 5b929895 authored by Marc Sune's avatar Marc Sune Committed by Marc Sune

Problem: duplicated socket_poller::wait() code

zmq::socket_poller_t::wait() had an important set of common lines
between POLL and SELECT variant.

Solution: refactor zmq::socket_poller_t::wait() and add the
following methods:

zmq::socket_poller_t::zero_trail_events()
zmq::socket_poller_t::check_events()
zmq::socket_poller_t::adjust_timeout()
Signed-off-by: 's avatarMarc Sune <mardevel@gmail.com>
parent a89d79aa
This diff is collapsed.
...@@ -81,6 +81,21 @@ namespace zmq ...@@ -81,6 +81,21 @@ namespace zmq
bool check_tag (); bool check_tag ();
private: private:
void zero_trail_events (zmq::socket_poller_t::event_t *events_,
int n_events_,
int found);
#if defined ZMQ_POLL_BASED_ON_POLL
int check_events (zmq::socket_poller_t::event_t *events_,
int n_events_);
#elif defined ZMQ_POLL_BASED_ON_SELECT
int check_events (zmq::socket_poller_t::event_t *events_, int n_events_,
fd_set& inset,
fd_set& outset,
fd_set& errset);
#endif
int adjust_timeout (zmq::clock_t& clock, long timeout_, uint64_t& now,
uint64_t& end,
bool& first_pass);
void rebuild (); void rebuild ();
// Used to check whether the object is a socket_poller. // Used to check whether the object is a socket_poller.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment