zmq_msg_get.txt 1.44 KB
Newer Older
1 2
zmq_msg_get(3)
==============
3 4 5 6


NAME
----
7
zmq_msg_get - get message property
8 9 10 11


SYNOPSIS
--------
12
*int zmq_msg_get (zmq_msg_t '*message', int 'property');*
13 14 15 16


DESCRIPTION
-----------
17 18 19
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.
20

21
The following properties can be retrieved with the _zmq_msg_get()_ function:
22 23

*ZMQ_MORE*::
24
Indicates that there are more message frames to follow after the 'message'.
25 26 27

RETURN VALUE
------------
28
The _zmq_msg_get()_ function shall return zero if successful. Otherwise it
29 30 31 32 33 34
shall return `-1` and set 'errno' to one of the values defined below.


ERRORS
------
*EINVAL*::
35
The requested _property_ is unknown.
36 37 38 39


EXAMPLE
-------
40
.Receiving a multi-frame message
41 42
----
while (true) {
43 44
    //  Create an empty 0MQ message to hold the message frame
    int rc = zmq_msg_init (&frame);
45
    assert (rc == 0);
46
    //  Block until a message is available to be received from socket
47
    rc = zmq_recvmsg (socket, &frame, 0);
48
    assert (rc != -1);
49
    if (zmq_msg_get (&frame, ZMQ_MORE))
50
        fprintf (stderr, "more\n");
51
    else {
52 53
        fprintf (stderr, "end\n");
        break;
54
    }
55
    zmq_msg_close (frame);
56 57 58 59 60 61
}
----


SEE ALSO
--------
62
linkzmq:zmq_msg_set[3]
63 64 65 66 67 68 69
linkzmq:zmq_msg_init[3]
linkzmq:zmq_msg_close[3]
linkzmq:zmq[7]


AUTHORS
-------
70 71
This 0MQ manual page was written by Chuck Remes <cremes@mac.com> and Pieter
Hintjens <ph@imatix.com>.