2012-02-16 02:28:29 +01:00
|
|
|
zmq_msg_get(3)
|
|
|
|
==============
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2012-02-16 02:28:29 +01:00
|
|
|
zmq_msg_get - get message options
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2012-02-16 02:28:29 +01:00
|
|
|
*int zmq_msg_get (zmq_msg_t '*message', int 'option_name', void '*option_value', size_t '*option_len');*
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2012-02-16 02:28:29 +01:00
|
|
|
The _zmq_msg_get()_ function shall retrieve the value for the option
|
2011-11-06 14:03:51 +01:00
|
|
|
specified by the 'option_name' argument for the message pointed to by the
|
|
|
|
'message' argument, and store it in the buffer pointed to by the 'option_value'
|
|
|
|
argument. The 'option_len' argument is the size in bytes of the buffer pointed
|
|
|
|
to by 'option_value'; upon successful completion _zmq_getsockopt()_ shall
|
|
|
|
modify the 'option_len' argument to indicate the actual size of the option
|
|
|
|
value stored in the buffer.
|
|
|
|
|
2012-02-16 02:28:29 +01:00
|
|
|
The following options can be retrieved with the _zmq_msg_get()_ function:
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
*ZMQ_MORE*::
|
|
|
|
Indicates that there are more message parts to follow after the 'message'.
|
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
------------
|
2012-02-16 02:28:29 +01:00
|
|
|
The _zmq_msg_get()_ function shall return zero if successful. Otherwise it
|
2011-11-06 14:03:51 +01:00
|
|
|
shall return `-1` and set 'errno' to one of the values defined below.
|
|
|
|
|
|
|
|
|
|
|
|
ERRORS
|
|
|
|
------
|
|
|
|
*EINVAL*::
|
|
|
|
The requested option _option_name_ is unknown, or the requested _option_size_ or
|
|
|
|
_option_value_ is invalid, or the size of the buffer pointed to by
|
|
|
|
_option_value_, as specified by _option_len_, is insufficient for storing the
|
|
|
|
option value.
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLE
|
|
|
|
-------
|
|
|
|
.Receiving a multi-part message
|
|
|
|
----
|
|
|
|
zmq_msg_t part;
|
|
|
|
int more;
|
|
|
|
size_t more_size = sizeof (more);
|
|
|
|
while (true) {
|
2012-02-16 01:41:09 +01:00
|
|
|
// Create an empty 0MQ message to hold the message part
|
2011-11-06 14:03:51 +01:00
|
|
|
int rc = zmq_msg_init (&part);
|
|
|
|
assert (rc == 0);
|
2012-02-16 01:41:09 +01:00
|
|
|
// Block until a message is available to be received from socket
|
2011-11-06 14:03:51 +01:00
|
|
|
rc = zmq_recvmsg (socket, &part, 0);
|
|
|
|
assert (rc != -1);
|
|
|
|
rc = getmsgopt (&part, ZMQ_MORE, &more, &more_size);
|
|
|
|
assert (rc == 0);
|
2012-02-16 01:41:09 +01:00
|
|
|
if (more)
|
|
|
|
fprintf (stderr, "more\n");
|
2011-11-06 14:03:51 +01:00
|
|
|
else {
|
2012-02-16 01:41:09 +01:00
|
|
|
fprintf (stderr, "end\n");
|
|
|
|
break;
|
2011-11-06 14:03:51 +01:00
|
|
|
}
|
|
|
|
zmq_msg_close (part);
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
2012-02-16 01:41:09 +01:00
|
|
|
linkzmq:zmq_msg_poke[3]
|
2011-11-06 14:03:51 +01:00
|
|
|
linkzmq:zmq_msg_init[3]
|
|
|
|
linkzmq:zmq_msg_close[3]
|
|
|
|
linkzmq:zmq[7]
|
|
|
|
|
|
|
|
|
|
|
|
AUTHORS
|
|
|
|
-------
|
2012-02-16 01:41:09 +01:00
|
|
|
This 0MQ manual page was written by Chuck Remes <cremes@mac.com> and Pieter
|
|
|
|
Hintjens <ph@imatix.com>.
|