[zeromq-dev] Paranoid Pirate
riskybizlive at live.com
Tue Aug 26 15:29:08 CEST 2014
Is it these lines which are the problem with c_str() in the Paranoid Pirate
msg.wrap (it->identity.c_str(), NULL);
What can be done to fix the problem, not using uuid identifiers? Replacing
uuids in the Paranoid Pirate Queue code with calls to s_set_id ()?
But it begs the question; how should the uuid identifiers be properly
handled and passed around in code? Surely Paranoid Pirate pattern must have
worked with uuids at some point in time otherwise how would it have passed
muster for the zeromq guide?
Date: Tue, 26 Aug 2014 06:15:54 +0800
From: KIU Shueng Chuan <nixchuan at gmail.com>
Subject: Re: [zeromq-dev] Paranoid Pirate
To: ZeroMQ development list <zeromq-dev at lists.zeromq.org>
<CAP2skc-=RLz92jXpXSAVmLFqRGAPjmoJh9Qn+b1yULAXfny+iw at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
The zmsg class api takes in char* and the pirate queue has code that passes
it identities as c_str(). This doesn't work since identities are not nul
terminated c strings and may contain nuls.
It works for the workers only because they explicitly set their own id to
something containing only characters. See s_set_id ().
On 26 Aug 2014 04:33, "Riskybiz" <riskybizlive at live.com> wrote:
> Dear zeromq developers,
> I'm trying to get the Paranoid Pirate pattern to
> operate on Debian Linux using zeromq-4.0.4. (When I get it working on
> Linux then I will turn my attention to making it work on Windows).
> The Paranoid Pirate Queue <http://pastebin.com/KTsn4Yq8> and the
> Paranoid Pirate Worker <http://pastebin.com/hLHRC2LB> are
> communicating and demonstrably heartbeating. The problem is that the
> Lazy Pirate Client <http://pastebin.com/Ekd1ZGQF> does not appear to
> communicate properly or receive a reply message. Is anyone able to
identify what is wrong here?
> There are a couple of other necessary files; zhelpers.h
> <http://pastebin.com/ir8bkQaU> and zmsg.hpp
> <http://pastebin.com/4KYir507> .
> I have changed int64_t more = 0; to int more = 0; as kindly pointed
> out by KIU Shueng Chuan as being necessary for zeromq-3.2.x and
> higher. Also added are some console print statements to trace what is
> actually going on. In order to correct very long waiting times I have
> modified the delay periods built in to the pattern from those provided
> by the stock example in the zeromq guide.
> Hope someone is able to help.
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
-------------- next part --------------
An HTML attachment was scrubbed...
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
End of zeromq-dev Digest, Vol 80, Issue 24
More information about the zeromq-dev