[zeromq-dev] Java to C++: junk appended to message?
Wolfgang Richter
wolf at cs.cmu.edu
Mon Aug 30 21:06:20 CEST 2010
I think forcing the users to allocate (not necessarily send) a '\0' byte is OK because it's leaving the encoding of data up to the user.
Specifically guarding for this in 0MQ might be nice, but I'm not sure we want bugs like this to propagate in user code. As in, later on in their app missing this 0 byte might cause other bugs. If 0MQ magically made it OK in some cases these could be masked.
--
Wolf
On Aug 30, 2010, at 2:56 PM, Pieter Hintjens <ph at imatix.com> wrote:
> 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
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list