[zeromq-dev] Java to C++: junk appended to message?
wolf at cs.cmu.edu
Mon Aug 30 20:31:21 CEST 2010
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.
Maybe I just like the simplicity 0MQ gives me.
On Aug 30, 2010, at 2:02 PM, Pieter Hintjens <ph at imatix.com> wrote:
> On Mon, Aug 30, 2010 at 7:29 PM, Naveen Chawla <naveen.chwl at gmail.com> wrote:
>> C++ to C++ works fine. Message is only "[Hello]"
> You're sending five bytes, 'Hello', which is not a valid C string as
> required by the printf function. Either send six bytes (string plus 0
> byte) or else convert the received message data to a valid string.
> I've wondered if 0MQ should not automatically and always append a null
> byte to received messages (not included in stated message size) so
> that strings can be safely passed between C/C++ and other languages.
> Pieter Hintjens
> iMatix - www.imatix.com
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
More information about the zeromq-dev