[zeromq-dev] Trouble sending from ROUTER to DEALER
Riskybiz
riskybizlive at live.com
Sun Sep 14 20:30:03 CEST 2014
Dear zeromq developers,
I've created a couple of simple Windows C++ console programs zmqDealerClient
<http://pastebin.com/1AqWXbTG> & zmqRouter <http://pastebin.com/jD4LsUKU>
to understand zeromq (4.0.4) ROUTER-DEALER connections. Both use the header
file multiPartMessage <http://pastebin.com/hhKDamzt> to handle the
preparation, sending and receiving of multipart messages. I can get a
message to pass from the DEALER to the ROUTER with the resultant console
output of:
router: Preparing
router: Ready to receive
--------------------------- Message Received ---------------------------
Originator Identity: 32768
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
------------------------------------------------------------------------
MultiPartMessage: Sending to connection identity: 32768
router: Ready to receive
However when zmqRouter attempts to send a reply from ROUTER back to the
originating DEALER then the message is not getting through properly and the
zmqDealerClient output stalls at;
dealerClient: Preparing
dealerClient: Dealer Socket Ready
dealerClient: MultiPartMessage Sent
dealerClient: Awaiting Reply
Along with the following error messages from zmqRouter;
[9668] MultiPartMessage: Error Sending Identity Message Part: Unknown error
[9668] MultiPartMessage: Error Sending Regular Message Part: Unknown error
[9668] MultiPartMessage: Error Sending Regular Message Part: Unknown error
[9668] MultiPartMessage: Error Sending Regular Message Part: Unknown error
The multi part message being sent via the ROUTER to the DEALER is prepended
with the identity of the DEALER socket, I'm unsure of the problem here; can
anyone explain what I've done wrong?
Also I notice that if I run two instances of zmqDealerClient in separate
console windows, both connecting to the same instance of zmqRouter, then
both clients appear to have the same identity. The code I've written uses
the default situation where the ROUTER socket sets the identities
internally. I expected each instance to have a unique identity. Anyone
know why this is not the case?
With thanks,
Riskybiz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140914/870ccb62/attachment.htm>
More information about the zeromq-dev
mailing list