~ubuntu-branches/ubuntu/trusty/zeromq3/trusty

« back to all changes in this revision

Viewing changes to doc/zmq_getmsgopt.txt

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-06-12 10:53:58 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120612105358-irh7e8ivwc4566fi
Tags: 3.2.0~rc1+dfsg-1
* New upstream RC release
* Use repack.{local,stub} instead of get-orig-source rule
* Add 01_fix-unused-variable-error.patch
* Remove build dependency on uuid-dev (no more needed)
* Add 02_check-ifdef-SO_NOSIGPIPE.patch to fix kfreebsd build
* Add 03_fix-test_shutdown_stress-segfault.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
zmq_getmsgopt(3)
2
 
================
3
 
 
4
 
 
5
 
NAME
6
 
----
7
 
zmq_getmsgopt - retrieve message option
8
 
 
9
 
 
10
 
SYNOPSIS
11
 
--------
12
 
*int zmq_getmsgopt (zmq_msg_t '*message', int 'option_name', void '*option_value', size_t '*option_len');*
13
 
 
14
 
 
15
 
DESCRIPTION
16
 
-----------
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.
24
 
 
25
 
The following options can be retrieved with the _zmq_getmsgopt()_ function:
26
 
 
27
 
*ZMQ_MORE*::
28
 
Indicates that there are more message parts to follow after the 'message'.
29
 
 
30
 
RETURN VALUE
31
 
------------
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.
34
 
 
35
 
 
36
 
ERRORS
37
 
------
38
 
*EINVAL*::
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
42
 
option value.
43
 
 
44
 
 
45
 
EXAMPLE
46
 
-------
47
 
.Receiving a multi-part message
48
 
----
49
 
zmq_msg_t part;
50
 
int more;
51
 
size_t more_size = sizeof (more);
52
 
while (true) {
53
 
    /* Create an empty 0MQ message to hold the message part */
54
 
    int rc = zmq_msg_init (&part);
55
 
    assert (rc == 0);
56
 
    /* Block until a message is available to be received from socket */
57
 
    rc = zmq_recvmsg (socket, &part, 0);
58
 
    assert (rc != -1);
59
 
    rc = getmsgopt (&part, ZMQ_MORE, &more, &more_size);
60
 
    assert (rc == 0);
61
 
    if (more) {
62
 
      fprintf (stderr, "more\n");
63
 
    }
64
 
    else {
65
 
      fprintf (stderr, "end\n");
66
 
      break;
67
 
    }
68
 
    zmq_msg_close (part);
69
 
}
70
 
----
71
 
 
72
 
 
73
 
SEE ALSO
74
 
--------
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]
80
 
linkzmq:zmq[7]
81
 
 
82
 
 
83
 
AUTHORS
84
 
-------
85
 
The 0MQ documentation was written by Chuck Remes <cremes@mac.com>.