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

Paul Colomiets paul at colomiets.name
Sun Nov 4 13:59:18 CET 2012


On Wed, Oct 31, 2012 at 9:02 PM, Kah-Chan Low <kahchanlow at yahoo.com> wrote:
> Thanks Paul!
> I followed your advice and checked for ZMQ_EVENTS after each each zmq_send()
> and it worked!
> I am still puzzled.
> 1. Checking for ZMQ_EVENT somehow resets the trigger, even if there is no
> message to be read.  Why is this necessary?

All of the zmq_send(), zmq_recv() and ZMQ_EVENT, reset trigger. This
is how internals of zeromq work.

> 2. ZMQ router does not need checking ZMQ_EVENT after zmq_send() for the read
> trigger to work properly.  Why?

I believe every socket needs that. The reason it works for you is just
because it happens to be no messages to be received when you do
zmq_send(). For instance, this is a case  when you send single request
at a time (requester sends a request, then sends next only when reply
from previous received).


More information about the zeromq-dev mailing list