[zeromq-dev] zmq_proxy_steerable

Brian Knox taotetek at gmail.com
Sun Dec 1 16:39:12 CET 2013


Hello!

I'm working on adding support for zmq_proxy_steerable commands to zproxy in
czmq.  I noticed I was getting an invalid proxy command error when trying
to send a "PAUSE" command using zstr_send.

Taking a look at the libzmq proxy.cpp code ~ line 117 on libzmq head (
https://github.com/zeromq/libzmq/blob/master/src/proxy.cpp#L117) , I see:

--------------------------------------------------
if (msg.size () == 6 && memcmp (msg.data (), "PAUSE", 6) == 0)
                state = paused;
----------------------------------------------------

My understanding is that zstr_send (from czmq) does not send the NULL at
the end of the string, and zstr_recv adds one (
https://github.com/zeromq/czmq/blob/master/src/zstr.c#L68 )

While I know libzmq is not czmq - I just want to make sure I understand the
libzmq code.  Should I be sending "PAUSE" with a null terminator, and is
that why the command check in proxy.cpp is looking for a message size of 6
rather than 5?

Thanks!
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131201/c4d53ad6/attachment.htm>


More information about the zeromq-dev mailing list