[zeromq-dev] Trouble sending from ROUTER to DEALER

Riskybiz riskybizlive at live.com
Fri Sep 19 15:24:28 CEST 2014

Many thanks for the inspiring code example and comments KIU Shueng Chuan
your suggestions were the answer.  The example is now passing messages as


One final issue baffles me though; despite the identity being stored in a
std::string and the reply message getting through from ROUTER to DEALER,
when the identity is printed to the console the output remains garbled.



I've updated the code at:

zmqRouter                         http://pastebin.com/jD4LsUKU

zmqDealerClient              http://pastebin.com/1AqWXbTG

multiPartMessage           http://pastebin.com/hhKDamzt




Date: Fri, 19 Sep 2014 07:50:18 +0800

From: KIU Shueng Chuan <nixchuan at gmail.com>

Subject: Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

To: ZeroMQ development list <zeromq-dev at lists.zeromq.org>


<CAP2skc-UKh+7jpm=C4SXo4=Z6-7xV=TV=+mKPaXbYZ4UZzqpPQ at mail.gmail.com>

Content-Type: text/plain; charset="iso-8859-1"


zmq_msg_init_size(&messageOut, sizeof id );


memcpy(zmq_msg_data(&messageOut), &id, sizeof id);


In the above 2 lines in your multipartmsg.h, replace "sizeof id" with
"id.size()" and "&id" with "id.data()".

-------------- next part --------------

An HTML attachment was scrubbed...





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140919/e21705a1/attachment.htm>

More information about the zeromq-dev mailing list