[zeromq-dev] poll does not return on a SUB socket

Martin Sustrik sustrik at 250bpm.com
Thu Dec 16 13:33:08 CET 2010


Hi Sven,

> In addition, a poll with 180 seconds (an 18 and 7 zeros) does NEVER wait
> so long, but return immediately. If there is no message available, it
> returns 0 as expected, but sometimes the ERRNO is set to 0 (SUCCESS) and
> sometimes ERRNO is set to 11 (Ressource temporarily not available). What
> do theese different ERRNOs mean? Can I understand ERRNO=11 as "there is
> no PUB socket connected"? (I bind the SUB and connect the PUB!)

If you have a look at zmq_poll man page you'll find out that zmq_poll 
waits *up to* specified number of microseconds. So yes, it can return 
prematurely. However, new version of 0MQ (2.1) honour the timeout precisely.

When timeout is reached, zmq_poll returns 0 but does not set the error. 
That means that errno can contain an error returned by some previous 
function or somesuch.

HTH
Martin




More information about the zeromq-dev mailing list