[zeromq-dev] Trouble sending from ROUTER to DEALER

Riskybiz riskybizlive at live.com
Tue Sep 16 16:19:56 CEST 2014

Apologies, I should have included the line I had used to determine the size
of the identity: 

"size_t id_size = (sizeof zmq_msg_data(&messageIn));//size in bytes"

I think this is the size of the data payload of the zmq_msg_t object, but
perhaps it is the size of the pointer returned from

Whereas your line is:

"printf("identity frame size: %ld bytes\n", zmq_msg_size(&messageIn));"

When run on my system I concur that your line gives output of "5 bytes".

router: Preparing
router: Ready to receive
identity frame size: 5 bytes
--------------------------- Message Received ---------------------------
Originator Identity: 32768 Identity Message Data Payload: 4bytes or 32bits
Frame Vector Index: 0 Frame Data: Frame1
Frame Vector Index: 1 Frame Data: Frame2
Frame Vector Index: 2 Frame Data: Frame3
Frame Vector Index: 3 Frame Data: Frame4
Frame Vector Index: 4 Frame Data: Frame5
MultiPartMessage: Sending to connection identity: 32768 Size of identity:
 or: 32bits
router: Ready to receive

Though I'm not sure how to use this information to make the example function
as intended.

I also tried added a blank message frame after the identity frame as
suggested by Rodrigo Mosconi, but that did not fix the problem.  I was
working under the impression that any sequence of zmq_msg_t objects could be
sent via a ROUTER socket so long as the identity of the destination was the
first frame?  Also that the 'blank' frame was necessary for certain socket
types only e.g. REQ-REP?



More information about the zeromq-dev mailing list