[zeromq-dev] Ruby binding s.recv returns 0-terminated string

Pieter Hintjens ph at imatix.com
Sun Mar 6 12:28:42 CET 2011


On Sun, Mar 6, 2011 at 12:21 PM, Mikko Koppanen
<mikko.koppanen at gmail.com> wrote:

> as the message data is an opaque binary blob I am not sure whether
> removing the trailing \0 is correct behaviour. If you are receiving a
> message with a trailing \0 it means that the sender has included it as
> a part of the message.

Indeed... this seems to be a fault in the sender. The convention for
strings encoded as 0MQ frames is to NOT include a terminating null
byte.

-Pieter



More information about the zeromq-dev mailing list