[zeromq-dev] Message initialisation

Lars Tandle Kyllingstad lars at kyllingen.net
Thu May 1 22:45:03 CEST 2014

On 01/05/14 19:50, Pieter Hintjens wrote:
> On Thu, May 1, 2014 at 6:35 PM, Lars Tandle Kyllingstad
> <lars at kyllingen.net> wrote:
> [...]
>> And my final question:  Is zmq_msg_init_size(&m, 0) by definition
>> equivalent to zmq_msg_init(&m)?  I have looked at the source code, and
>> it seems the two cases are currently implemented in the same way, but my
>> question is whether this is by specification, or whether it is an
>> implementation detail that may change in future versions.
> Not documented, so open for change. If you think this should be
> formally specified, the right place would be the man pages, and if
> it's critical, then in a test case as well.

Unless anyone can think of a reason for why a "zero-size" message would 
ever be different from an "empty" message, I do think it should be 
specified that they are equivalent.  That way, users aren't left 
wondering which one to use when they simply want to send a zero-length 
frame, and wrapper authors like myself won't have to burden the API with 
an additional constructor.  (If they are the same, I only need one 
constructor with an optional 'size' parameter that defaults to zero.)

I guess the man pages are generated from doc/*.txt in the libzmq repo?

>> If anyone is interested in my work, check out:
>>       https://github.com/kyllingstad/zmqd
> Nice! See http://zeromq.org/docs:organization, it may be interesting to you.

Definitely interesting.  I want to let my API mature a bit more before I 
request a move to your organisation, though.



More information about the zeromq-dev mailing list