1ZMQ_MSG_MORE(3) 0MQ Manual ZMQ_MSG_MORE(3)
2
3
4
6 zmq_msg_more - indicate if there are more message parts to receive
7
9 int zmq_msg_more (zmq_msg_t *message);
10
12 The zmq_msg_more() function indicates whether this is part of a
13 multi-part message, and there are further parts to receive. This method
14 can safely be called after zmq_msg_close(). This method is identical to
15 zmq_msg_get() with an argument of ZMQ_MORE.
16
18 The zmq_msg_more() function shall return zero if this is the final part
19 of a multi-part message, or the only part of a single-part message. It
20 shall return 1 if there are further parts to receive.
21
23 Receiving a multi-part message.
24
25 zmq_msg_t part;
26 while (true) {
27 // Create an empty 0MQ message to hold the message part
28 int rc = zmq_msg_init (&part);
29 assert (rc == 0);
30 // Block until a message is available to be received from socket
31 rc = zmq_msg_recv (socket, &part, 0);
32 assert (rc != -1);
33 if (zmq_msg_more (&part))
34 fprintf (stderr, "more\n");
35 else {
36 fprintf (stderr, "end\n");
37 break;
38 }
39 zmq_msg_close (&part);
40 }
41
42
44 zmq_msg_get(3) zmq_msg_set(3) zmq_msg_init(3) zmq_msg_close(3) zmq(7)
45
47 This page was written by the 0MQ community. To make a change please
48 read the 0MQ Contribution Policy at
49 http://www.zeromq.org/docs:contributing.
50
51
52
530MQ 4.3.4 01/30/2021 ZMQ_MSG_MORE(3)