[zeromq-dev] Problems with zmq_poll

Martin Sustrik sustrik at 250bpm.com
Tue Feb 16 08:25:04 CET 2010

Hi Brian,

> I have an initial implementation of zmq_poll for the Python bindings,
> but it is not working.  I am seeing a:
> Unknown error: 0
> When zmq_poll returns.  I am using latest trunk of 0MQ of Mac OS X and
> have tried various kinds of sockets
> (REQ/REP, PUB/SUB).  Questions:
> * What does the the Unknown Error: 0 indicate.
> * Is there a simple C/C++ examples that I can run to test that
> zmq_poll works on OS X?
> * Any other ideas about what might be going on.
> Here is the code:
> http://github.com/ellisonbg/pyzmq/blob/master/zmq/_zmq.pyx#L422
> For now, I want to figure out if this is a problem with 0MQ on OS X or
> my python bindings.

No, the problem are the return values from zmq_poll. You are handling 
them this way:

     rc = zmq_poll(pollitems, nsockets, timeout)
     if rc != 0:
         raise ZMQError(zmq_strerror(errno))

zmq_poll returns number of items signaled, -1 in the case of error or 0 
in case of timeout.


More information about the zeromq-dev mailing list