[zeromq-dev] zmq_msg_data problem

Pieter Hintjens ph at imatix.com
Tue Oct 18 00:57:16 CEST 2011


On Mon, Oct 17, 2011 at 5:19 PM, Mark Libucha <mlibucha at gmail.com> wrote:

> I'm using the latest stable zmq (v2.1.10) and Java bindings. My client is
> Java and server is C. This code in the server:
>
> 2011-10-17 17:45:18,903 size=2808
> 2011-10-17 17:45:18,903 size=2809

Presumably caused by the lack of a trailing 0 on data you get from
Java and try to process in C. Read the section in the Guide on 0MQ
strings, and when you receive string data in C apps, copy into a new
buffer and add a trailing null (the CZMQ zstr class does this for you
automatically).

-Pieter



More information about the zeromq-dev mailing list