[zeromq-dev] Multi-part messages

Steven McCoy steven.mccoy at miru.hk
Wed Apr 14 12:23:13 CEST 2010

On 7 April 2010 04:15, Martin Sustrik <sustrik at 250bpm.com> wrote:
> Thus, messages users are dealing with would have no "continuation bit",
> they would remain simple BLOBs with no special properties.

Just noticed MSG_MORE has different meaning than ZMQ_MORE.

MSG_MORE means you are squeezing more user data into one transport message,
therefore it is incorrect to have a ZMQ_MORE on the receive side as it does
not know the sent part sizes.

zmq::message_t part1 (100);
s.send (part1, ZMQ_MORE);
zmq::message_t part2 (100);
s.send (part2);
// sends one message 200 bytes long

The equivalent appears to be MSG_EOR albeit reverse semantics and breaks the
default operation which is why it has a new socket type SOCK_SEQPACKET.


zmq::message_t part1 (100);
s.send (part1);
zmq::message_t part2 (100);
s.send (part2, ZMQ_EOR);
// sends one two-part message (record)

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

More information about the zeromq-dev mailing list