File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -1091,14 +1091,14 @@ template <typename T = void> class poller_t
1091
1091
}
1092
1092
}
1093
1093
1094
- int wait_all (std::vector<zmq_poller_event_t > &poller_events,
1095
- const std::chrono::microseconds timeout)
1094
+ size_t wait_all (std::vector<zmq_poller_event_t > &poller_events,
1095
+ const std::chrono::microseconds timeout)
1096
1096
{
1097
1097
int rc = zmq_poller_wait_all (poller_ptr.get (), poller_events.data (),
1098
1098
static_cast <int > (poller_events.size ()),
1099
1099
static_cast <long > (timeout.count ()));
1100
1100
if (rc > 0 )
1101
- return rc ;
1101
+ return static_cast < size_t > (rc) ;
1102
1102
1103
1103
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3)
1104
1104
if (zmq_errno () == EAGAIN)
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ class active_poller_t
398
398
base_poller.modify (socket, events);
399
399
}
400
400
401
- int wait (std::chrono::milliseconds timeout)
401
+ size_t wait (std::chrono::milliseconds timeout)
402
402
{
403
403
if (need_rebuild) {
404
404
poller_events.resize (handlers.size ());
@@ -409,16 +409,13 @@ class active_poller_t
409
409
}
410
410
need_rebuild = false ;
411
411
}
412
- const int count = base_poller.wait_all (poller_events, timeout);
413
- if (count != 0 ) {
414
- std::for_each (poller_events.begin (),
415
- poller_events.begin () + count,
416
- [](zmq_poller_event_t &event) {
417
- if (event.user_data != NULL )
418
- (*reinterpret_cast <handler_t *> (
419
- event.user_data )) (event.events );
420
- });
421
- }
412
+ const auto count = base_poller.wait_all (poller_events, timeout);
413
+ std::for_each (poller_events.begin (), poller_events.begin () + count,
414
+ [](zmq_poller_event_t &event) {
415
+ if (event.user_data != NULL )
416
+ (*reinterpret_cast <handler_t *> (
417
+ event.user_data )) (event.events );
418
+ });
422
419
return count;
423
420
}
424
421
You can’t perform that action at this time.
0 commit comments