7
zmq_getmsgopt - retrieve message option
12
*int zmq_getmsgopt (zmq_msg_t '*message', int 'option_name', void '*option_value', size_t '*option_len');*
17
The _zmq_getmsgopt()_ function shall retrieve the value for the option
18
specified by the 'option_name' argument for the message pointed to by the
19
'message' argument, and store it in the buffer pointed to by the 'option_value'
20
argument. The 'option_len' argument is the size in bytes of the buffer pointed
21
to by 'option_value'; upon successful completion _zmq_getsockopt()_ shall
22
modify the 'option_len' argument to indicate the actual size of the option
23
value stored in the buffer.
25
The following options can be retrieved with the _zmq_getmsgopt()_ function:
28
Indicates that there are more message parts to follow after the 'message'.
32
The _zmq_getmsgopt()_ function shall return zero if successful. Otherwise it
33
shall return `-1` and set 'errno' to one of the values defined below.
39
The requested option _option_name_ is unknown, or the requested _option_size_ or
40
_option_value_ is invalid, or the size of the buffer pointed to by
41
_option_value_, as specified by _option_len_, is insufficient for storing the
47
.Receiving a multi-part message
51
size_t more_size = sizeof (more);
53
/* Create an empty 0MQ message to hold the message part */
54
int rc = zmq_msg_init (&part);
56
/* Block until a message is available to be received from socket */
57
rc = zmq_recvmsg (socket, &part, 0);
59
rc = getmsgopt (&part, ZMQ_MORE, &more, &more_size);
62
fprintf (stderr, "more\n");
65
fprintf (stderr, "end\n");
75
linkzmq:zmq_msg_data[3]
76
linkzmq:zmq_msg_init[3]
77
linkzmq:zmq_msg_init_size[3]
78
linkzmq:zmq_msg_init_data[3]
79
linkzmq:zmq_msg_close[3]
85
The 0MQ documentation was written by Chuck Remes <cremes@mac.com>.