Is it these lines which are the problem with c_str() in  the Paranoid Pirate
Queue?

msg.push_front((char*)identity.c_str());

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?

Confused.

Riskybiz.


Message: 8
Date: Tue, 26 Aug 2014 06:15:54 +0800
From: KIU Shueng Chuan <nixch...@gmail.com>
Subject: Re: [zeromq-dev] Paranoid Pirate
To: ZeroMQ development list <zeromq-dev@lists.zeromq.org>
Message-ID:
        <CAP2skc-=rlz92jxpxsavmlfqrgapjmojh9qn+b1yulaxfny...@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" <riskybizl...@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.
>
> Thanks,
>
> Riskybiz.
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140826/03acd436/a
ttachment-0001.htm 

------------------------------

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


End of zeromq-dev Digest, Vol 80, Issue 24
******************************************

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to