mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-29 16:45:51 +08:00
Merge pull request #1893 from paddor/master
This commit is contained in:
commit
f6f89a84d9
@ -528,13 +528,19 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *event_, long time
|
|||||||
#elif defined ZMQ_POLL_BASED_ON_SELECT
|
#elif defined ZMQ_POLL_BASED_ON_SELECT
|
||||||
|
|
||||||
if (unlikely (poll_size == 0)) {
|
if (unlikely (poll_size == 0)) {
|
||||||
|
// We'll report an error (timed out) as if the list was non-empty and
|
||||||
|
// no event occured within the specified timeout. Otherwise the caller
|
||||||
|
// needs to check the return value AND the event to avoid using the
|
||||||
|
// nullified event data.
|
||||||
|
errno = ETIMEDOUT;
|
||||||
if (timeout_ == 0)
|
if (timeout_ == 0)
|
||||||
return 0;
|
return -1;
|
||||||
#if defined ZMQ_HAVE_WINDOWS
|
#if defined ZMQ_HAVE_WINDOWS
|
||||||
Sleep (timeout_ > 0 ? timeout_ : INFINITE);
|
Sleep (timeout_ > 0 ? timeout_ : INFINITE);
|
||||||
return 0;
|
return -1;
|
||||||
#else
|
#else
|
||||||
return usleep (timeout_ * 1000);
|
usleep (timeout_ * 1000);
|
||||||
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
zmq::clock_t clock;
|
zmq::clock_t clock;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user