[zeromq-dev] Dipping into zmq_recv from czmq

Aaron Sokoloski asokoloski at gmail.com
Wed May 3 19:06:07 CEST 2017

Hi Brian,

I'm far from an expert on this, but it looks like the zsock_resolve method
will return the underlying zmq_socket, and then you can do what you want
with it.

Someone else may be able to chip in with a more idiomatic solution to your
problem, though.


On 3 May 2017 at 10:53, Brian Sellden <brian_ls2 at comcast.net> wrote:

> Hello,
> I’m using czmq to transfer serialized objects in char arrays.  The
> serialized data may contain nulls, so processing with c-string oriented
> functions Is a problem.  So using zstr_recv(void*) doesn’t work for me as
> it returns a char* with no way to identify the length of the array.
> I thought I might dip into the zmq calls directly so I can use
> zmq_recv(void* source, void* buf, size_t len, int flags), as it returns the
> number of bytes copied into the buffer.  But my sockets are created with
> zsock_new(…), so I’m not sure about the compatibility of these calls.  Am I
> on the right track with this, and can someone offer some advice on how to
> proceed?  I did try just putting my zsock_t* into the zmq_recv call, but it
> just returns -1 even though zpoller_t reports that there is data available
> on the socket.
> Thanks –
> Brian.
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170503/471e6569/attachment.htm>

More information about the zeromq-dev mailing list