[zeromq-dev] Multi-part messages

Steven McCoy steven.mccoy at miru.hk
Tue Apr 6 16:34:06 CEST 2010


On 6 April 2010 22:09, Martin Lucina <mato at kotelna.sk> wrote:

> sustrik at 250bpm.com said:
> > What about this:
> >
> >      ...
> >      zmq_recv (s, &msg, 0);
> >      int more;
> >      getsockopt (s, ZMQ_MORE, &more);
> >      if (more) ...
> >
> > In other words, to make "has more undelivered message parts" a property
> > of the receiving socket.
>
> That just feels wrong...
>
>
Try to leverage existing APIs, the recvmsg() seems most appropriate.

struct zmq_msghdr {
  void* zmsg_buf
  size_t zmsg_len;
  int  zmsg_flags;
} msgh;
zmq_recvmsg (s, &msgh);
if (msgh.zmsg_flags & ZMQ_MORE) {
...
}

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100406/dc0296b8/attachment.html>


More information about the zeromq-dev mailing list