2012-02-16 02:28:29 +01:00
|
|
|
zmq_msg_get(3)
|
|
|
|
==============
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2012-03-21 20:19:40 +01:00
|
|
|
zmq_msg_get - get message property
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2012-03-21 20:19:40 +01:00
|
|
|
*int zmq_msg_get (zmq_msg_t '*message', int 'property');*
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2012-03-21 20:19:40 +01:00
|
|
|
The _zmq_msg_get()_ function shall return the value for the property
|
|
|
|
specified by the 'property' argument for the message pointed to by the
|
|
|
|
'message' argument.
|
2011-11-06 14:03:51 +01:00
|
|
|
|
2012-03-21 20:19:40 +01:00
|
|
|
The following properties can be retrieved with the _zmq_msg_get()_ function:
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
*ZMQ_MORE*::
|
2012-03-21 20:19:40 +01:00
|
|
|
Indicates that there are more message frames to follow after the 'message'.
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
RETURN VALUE
|
|
|
|
------------
|
2012-09-20 20:39:45 +02:00
|
|
|
The _zmq_msg_get()_ function shall return the value for the property if
|
|
|
|
successful. Otherwise it shall return `-1` and set 'errno' to one of the
|
|
|
|
values defined below.
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
ERRORS
|
|
|
|
------
|
|
|
|
*EINVAL*::
|
2012-03-21 20:19:40 +01:00
|
|
|
The requested _property_ is unknown.
|
2011-11-06 14:03:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
EXAMPLE
|
|
|
|
-------
|
2012-03-21 20:19:40 +01:00
|
|
|
.Receiving a multi-frame message
|
2011-11-06 14:03:51 +01:00
|
|
|
----
|
|
|
|
while (true) {
|
2012-03-21 20:19:40 +01:00
|
|
|
// Create an empty 0MQ message to hold the message frame
|
|
|
|
int rc = zmq_msg_init (&frame);
|
2011-11-06 14:03:51 +01:00
|
|
|
assert (rc == 0);
|
2012-02-16 01:41:09 +01:00
|
|
|
// Block until a message is available to be received from socket
|
2012-12-23 17:47:32 +01:00
|
|
|
rc = zmq_msg_recv (socket, &frame, 0);
|
2011-11-06 14:03:51 +01:00
|
|
|
assert (rc != -1);
|
2012-03-21 20:19:40 +01:00
|
|
|
if (zmq_msg_get (&frame, ZMQ_MORE))
|
2012-02-16 01:41:09 +01:00
|
|
|
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
|
|
|
}
|
2012-03-21 20:19:40 +01:00
|
|
|
zmq_msg_close (frame);
|
2011-11-06 14:03:51 +01:00
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
2012-03-21 20:19:40 +01:00
|
|
|
linkzmq:zmq_msg_set[3]
|
2011-11-06 14:03:51 +01:00
|
|
|
linkzmq:zmq_msg_init[3]
|
|
|
|
linkzmq:zmq_msg_close[3]
|
|
|
|
linkzmq:zmq[7]
|
|
|
|
|
|
|
|
|
|
|
|
AUTHORS
|
|
|
|
-------
|
2013-04-11 18:53:02 +02:00
|
|
|
This page was written by the 0MQ community. To make a change please
|
|
|
|
read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.
|