[zeromq-dev] zmsg.hpp

Martin Lucina mato at kotelna.sk
Wed May 4 13:00:10 CEST 2011


ph at imatix.com said:
> On Thu, Apr 28, 2011 at 4:00 PM, Ilja Golshtein <ilejncs at narod.ru> wrote:
> 
> > a couple of questions about zmsg.hpp , mentioned in zguide.
> 
> Not sure where you're seeing the reference, it shouldn't be mentioned
> in the text. Perhaps in the C++ examples?
> 
> > 1. Where is the official source of it? What is the status of the code?
> 
> This was based on the C zmsg.h proto-API. That became part of libzapi
> which became czmq.
> 
> That raft of changes is explained here:
> http://zguide.zeromq.org/main:author-notes
> 
> The code is valid but IMO should be replaced (as the C code was) by a
> proper high-level C++ API (cppzmq), since it's unfortunate to base
> examples on adhoc APIs.
> 
> > The question is if it reliable to assume zeromq message is ASCIIZ, what
> > we effectively do in the latest line I've quoted?
> 
> I've covered this in the Guide quite early on since it's a major
> problem. It is unsafe to assume in C/C++ a message is ASCIIZ because
> that breaks interop with other languages.
> 
> 0MQ strings are length-specified. One of the classes that czmq
> provides is zstr which reads/writes C strings to/from 0MQ strings.
> Similar functionality is in the zmsg.hpp header too.

"0MQ strings"? /me does not know that such a thing exists...

Incidentally, a couple of times I got people saying "0MQ messages are
ASCIIZ strings", which is complete bogus. They seem to get this idea from
the guide ... :-/

-mato



More information about the zeromq-dev mailing list