[zeromq-dev] zmq_poll: timeout issue

Martin Lucina mato at kotelna.sk
Tue Aug 10 15:39:03 CEST 2010


Hi,

ilejncs at narod.ru said:
> I am observing rather strange zmq_poll behavior.
> It is triggered by timeout and works fine if  -1.

This is a known issue with the current zmq_poll() implementation. The
zmq_poll(3) documentation mentions this, albeit briefly:

    Important
        The zmq_poll() function may return before the timeout period has
        expired even if no events have been signaled.

The solution at the moment is either to use an infinite timeout, or manage
the timeout yourself (i.e. call gettimeofday(), recalculate remaining
timeout and restart the zmq_poll()).

There is a work in progress branch of the code not ready for public
consumption yet which will contain a new zmq_poll() implementation with
proper timeout handling.

-mato



More information about the zeromq-dev mailing list