[zeromq-dev] zmq_msg_init() documentation for version 4.2 calling wrong recv function

Bob Eby ebyrob at gmail.com
Tue Nov 7 17:05:03 CET 2017

The 4.2 documentation for zmq_msg_init() has this code sample at the bottom:

   zmq_msg_t msg;
   rc = zmq_msg_init (&msg);
   assert (rc == 0);
   int nbytes = zmq_recv (socket, &msg, 0); assert (nbytes != -1);

However, looking in my headers I only see the following zmq receive

   include\zmq.h:ZMQ_EXPORT int zmq_msg_recv (zmq_msg_t *msg, void *s, int
   include\zmq.h:ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len,
int flags);
   include\zmq.h:ZMQ_EXPORT int zmq_recvmsg (void *s, zmq_msg_t *msg, int
   include\zmq.h:ZMQ_EXPORT int zmq_recviov (void *s, struct iovec *iov,
size_t *count, int flags);

zmq_recv() takes 4 parameters not 3, perhaps the example should call
zmq_msg_recv() instead?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20171107/f041b553/attachment.htm>

More information about the zeromq-dev mailing list