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

« back to all changes in this revision

Viewing changes to doc/zmq_getmsgopt.3

  • 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
 
'\" t
2
 
.\"     Title: zmq_getmsgopt
3
 
.\"    Author: [see the "AUTHORS" section]
4
 
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5
 
.\"      Date: 12/18/2011
6
 
.\"    Manual: 0MQ Manual
7
 
.\"    Source: 0MQ 3.1.0
8
 
.\"  Language: English
9
 
.\"
10
 
.TH "ZMQ_GETMSGOPT" "3" "12/18/2011" "0MQ 3\&.1\&.0" "0MQ Manual"
11
 
.\" -----------------------------------------------------------------
12
 
.\" * Define some portability stuff
13
 
.\" -----------------------------------------------------------------
14
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
 
.\" http://bugs.debian.org/507673
16
 
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
 
.ie \n(.g .ds Aq \(aq
19
 
.el       .ds Aq '
20
 
.\" -----------------------------------------------------------------
21
 
.\" * set default formatting
22
 
.\" -----------------------------------------------------------------
23
 
.\" disable hyphenation
24
 
.nh
25
 
.\" disable justification (adjust text to left margin only)
26
 
.ad l
27
 
.\" -----------------------------------------------------------------
28
 
.\" * MAIN CONTENT STARTS HERE *
29
 
.\" -----------------------------------------------------------------
30
 
.SH "NAME"
31
 
zmq_getmsgopt \- retrieve message option
32
 
.SH "SYNOPSIS"
33
 
.sp
34
 
\fBint zmq_getmsgopt (zmq_msg_t \fR\fB\fI*message\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, void \fR\fB\fI*option_value\fR\fR\fB, size_t \fR\fB\fI*option_len\fR\fR\fB);\fR
35
 
.SH "DESCRIPTION"
36
 
.sp
37
 
The \fIzmq_getmsgopt()\fR function shall retrieve the value for the option specified by the \fIoption_name\fR argument for the message pointed to by the \fImessage\fR argument, and store it in the buffer pointed to by the \fIoption_value\fR argument\&. The \fIoption_len\fR argument is the size in bytes of the buffer pointed to by \fIoption_value\fR; upon successful completion \fIzmq_getsockopt()\fR shall modify the \fIoption_len\fR argument to indicate the actual size of the option value stored in the buffer\&.
38
 
.sp
39
 
The following options can be retrieved with the \fIzmq_getmsgopt()\fR function:
40
 
.PP
41
 
\fBZMQ_MORE\fR
42
 
.RS 4
43
 
Indicates that there are more message parts to follow after the
44
 
\fImessage\fR\&.
45
 
.RE
46
 
.SH "RETURN VALUE"
47
 
.sp
48
 
The \fIzmq_getmsgopt()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
49
 
.SH "ERRORS"
50
 
.PP
51
 
\fBEINVAL\fR
52
 
.RS 4
53
 
The requested option
54
 
\fIoption_name\fR
55
 
is unknown, or the requested
56
 
\fIoption_size\fR
57
 
or
58
 
\fIoption_value\fR
59
 
is invalid, or the size of the buffer pointed to by
60
 
\fIoption_value\fR, as specified by
61
 
\fIoption_len\fR, is insufficient for storing the option value\&.
62
 
.RE
63
 
.SH "EXAMPLE"
64
 
.PP
65
 
\fBReceiving a multi-part message\fR. 
66
 
.sp
67
 
.if n \{\
68
 
.RS 4
69
 
.\}
70
 
.nf
71
 
zmq_msg_t part;
72
 
int more;
73
 
size_t more_size = sizeof (more);
74
 
while (true) {
75
 
    /* Create an empty 0MQ message to hold the message part */
76
 
    int rc = zmq_msg_init (&part);
77
 
    assert (rc == 0);
78
 
    /* Block until a message is available to be received from socket */
79
 
    rc = zmq_recvmsg (socket, &part, 0);
80
 
    assert (rc != \-1);
81
 
    rc = getmsgopt (&part, ZMQ_MORE, &more, &more_size);
82
 
    assert (rc == 0);
83
 
    if (more) {
84
 
      fprintf (stderr, "more\en");
85
 
    }
86
 
    else {
87
 
      fprintf (stderr, "end\en");
88
 
      break;
89
 
    }
90
 
    zmq_msg_close (part);
91
 
}
92
 
.fi
93
 
.if n \{\
94
 
.RE
95
 
.\}
96
 
.sp
97
 
.SH "SEE ALSO"
98
 
.sp
99
 
\fBzmq_msg_data\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7)
100
 
.SH "AUTHORS"
101
 
.sp
102
 
The 0MQ documentation was written by Chuck Remes <\m[blue]\fBcremes@mac\&.com\fR\m[]\&\s-2\u[1]\d\s+2>\&.
103
 
.SH "NOTES"
104
 
.IP " 1." 4
105
 
cremes@mac.com
106
 
.RS 4
107
 
\%mailto:cremes@mac.com
108
 
.RE