~ubuntu-branches/ubuntu/saucy/zeromq3/saucy

« back to all changes in this revision

Viewing changes to doc/zmq_msg_init.3

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-06-04 21:21:09 UTC
  • Revision ID: package-import@ubuntu.com-20120604212109-b7b3m0rn21o8oo2q
Tags: upstream-3.1.0~beta+dfsg
ImportĀ upstreamĀ versionĀ 3.1.0~beta+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: zmq_msg_init
 
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_MSG_INIT" "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_msg_init \- initialise empty 0MQ message
 
32
.SH "SYNOPSIS"
 
33
.sp
 
34
\fBint zmq_msg_init (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB);\fR
 
35
.SH "DESCRIPTION"
 
36
.sp
 
37
The \fIzmq_msg_init()\fR function shall initialise the message object referenced by \fImsg\fR to represent an empty message\&. This function is most useful when called before receiving a message with \fIzmq_recv()\fR\&.
 
38
.if n \{\
 
39
.sp
 
40
.\}
 
41
.RS 4
 
42
.it 1 an-trap
 
43
.nr an-no-space-flag 1
 
44
.nr an-break-flag 1
 
45
.br
 
46
.ps +1
 
47
\fBCaution\fR
 
48
.ps -1
 
49
.br
 
50
.sp
 
51
Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&.
 
52
.sp .5v
 
53
.RE
 
54
.if n \{\
 
55
.sp
 
56
.\}
 
57
.RS 4
 
58
.it 1 an-trap
 
59
.nr an-no-space-flag 1
 
60
.nr an-break-flag 1
 
61
.br
 
62
.ps +1
 
63
\fBCaution\fR
 
64
.ps -1
 
65
.br
 
66
.sp
 
67
The functions \fIzmq_msg_init()\fR, \fIzmq_msg_init_data()\fR and \fIzmq_msg_init_size()\fR are mutually exclusive\&. Never initialize the same \fIzmq_msg_t\fR twice\&.
 
68
.sp .5v
 
69
.RE
 
70
.SH "RETURN VALUE"
 
71
.sp
 
72
The \fIzmq_msg_init()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
 
73
.SH "ERRORS"
 
74
.sp
 
75
No errors are defined\&.
 
76
.SH "EXAMPLE"
 
77
.PP
 
78
\fBReceiving a message from a socket\fR. 
 
79
.sp
 
80
.if n \{\
 
81
.RS 4
 
82
.\}
 
83
.nf
 
84
zmq_msg_t msg;
 
85
rc = zmq_msg_init (&msg);
 
86
assert (rc == 0);
 
87
rc = zmq_recv (socket, &msg, 0);
 
88
assert (rc == 0);
 
89
.fi
 
90
.if n \{\
 
91
.RE
 
92
.\}
 
93
.sp
 
94
.SH "SEE ALSO"
 
95
.sp
 
96
\fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7)
 
97
.SH "AUTHORS"
 
98
.sp
 
99
The 0MQ documentation was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmartin@lucina\&.net\fR\m[]\&\s-2\u[2]\d\s+2>\&.
 
100
.SH "NOTES"
 
101
.IP " 1." 4
 
102
sustrik@250bpm.com
 
103
.RS 4
 
104
\%mailto:sustrik@250bpm.com
 
105
.RE
 
106
.IP " 2." 4
 
107
martin@lucina.net
 
108
.RS 4
 
109
\%mailto:martin@lucina.net
 
110
.RE