[zeromq-dev] Java to C++: junk appended to message?

Pieter Hintjens ph at imatix.com
Mon Aug 30 20:56:02 CEST 2010

On Mon, Aug 30, 2010 at 8:52 PM, Pieter Hintjens <ph at imatix.com> wrote:
> On Mon, Aug 30, 2010 at 8:31 PM, Wolfgang Richter <wolf at cs.cmu.edu> wrote:
>> I don't think it should automatically append a byte.  The guarantee that 0MQ sends exactly the bytes I give it is perfect.  Modifying data almost invisibly isn't good in my opinion.
> Not modifying.  Allocating 1 extra byte invisibly, and sticking a null in it...

And this only on received data.  I.e. it does not affect what's sent,
but it provides apps with buffers that are guarded so that character
data can safely be printed in languages that require a trailing null.

The alternative for apps is to always send that extra null, which
doesn't seem an elegant solution.

Pieter Hintjens
iMatix - www.imatix.com

More information about the zeromq-dev mailing list