[zeromq-dev] Router-Dealer Example not working in C on 4.0.4 ZMQ release

Pieter Hintjens ph at imatix.com
Fri Jul 25 10:33:08 CEST 2014


Sorry if that email seemed unpolite; it was late and I'd been driving
for 10 hours with three small kids who refused to sleep.

So, ROUTER sockets always prefix the incoming message with an extra
frame that holds a routing id (aka "identity"), that identifies which
pipe the message came in from. You stick that same frame back before
outgoing replies, and the ROUTER socket then knows which pipe to send
it to.

These IDs start with a binary zero. If you try to printf them, the
result is an empty string. In my example code, if you tried it, the
print shows this ID frame quite clearly.

This is explained in detail in Chapter 3 of the Guide, and briefly in
the zmq_socket man page for ZMQ_ROUTER.

It is not trivial, and you should really read the Guide and work
through the examples before trying to use ROUTER.

-Pieter

On Fri, Jul 25, 2014 at 12:53 AM, Pieter Hintjens <ph at imatix.com> wrote:
> You're not reading the man pages, nor documentation, nor example
> output properly.



More information about the zeromq-dev mailing list