[zeromq-dev] ZMQ dealer not receiving message from ZMQ router with ZMQ_FD

Paul Colomiets paul at colomiets.name
Wed Oct 31 09:44:47 CET 2012


On Wed, Oct 31, 2012 at 5:03 AM, Kah-Chan Low <kahchanlow at yahoo.com> wrote:
> I have read about the caveats of using ZMQ_FD so once an event is triggered,
> I do use ZMQ_EVENTS to test for ZMQ_POLLIN before calling zmq_recv()
> I also make use that I read all messages off a socket once a read event i
> triggered.
> [...]
> I have read that some people had similar problems and they were advised to
> keep reading until EAGAIN before calling select(). I can't do that since the
> ZMQ dealer is only one of a number of sockets owned by the thread and any
> one of them may receive a message at any time.

I'm not sure how those two paragraphs are connected. Do you check for
ZMQ_EVENTS until it gets becomes unreadable, instead of doing zmq_recv
until EAGAIN?

If you are, that's ok. You must also check for ZMQ_EVENTS after each
zmq_send, before calling select.


More information about the zeromq-dev mailing list