[zeromq-dev] zmq_recv documentation

Varol Okan varokan at movingsatellites.com
Wed Apr 28 04:55:50 CEST 2010

I was trying to get zmq_poll working but for some reason my app crashes
event when I init the ctx with the ZMQ_POLL flag.

It'll crash inside zmq_poll at :
pollfds [npollfds].fd = app_thread->get_signaler ()->get_fd ();
for some reasons app_thread->get_signaler () is NULL.

Anyhow, I just thought I drop a line wrt the zmq_recv documentation.

Looking at the *ZMQ_NOBLOCK *section it states
Specifies that the operation should be performed in non-blocking mode.
If there are no messages available to be dequeued from the underlying
/message queue/ associated with /socket/, the /zmq_recv()/ function
shall fail with /errno/ set to EAGAIN.

So I was expecting the function to return -1, as stated a few lines
further down
The /zmq_recv()/ function shall return zero if successful. Otherwise it
shall return -1 and set /errno/ to one of the values defined below.

However if no msg is available it'll return 0, else 1. ( on Linux )

Smehow there seems to be a disconnect between those two.

Varol :)

More information about the zeromq-dev mailing list