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

« back to all changes in this revision

Viewing changes to doc/zmq_bind.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_bind
 
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_BIND" "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_bind \- accept connections on a socket
 
32
.SH "SYNOPSIS"
 
33
.sp
 
34
\fBint zmq_bind (void \fR\fB\fI*socket\fR\fR\fB, const char \fR\fB\fI*endpoint\fR\fR\fB);\fR
 
35
.SH "DESCRIPTION"
 
36
.sp
 
37
The \fIzmq_bind()\fR function shall create an endpoint for accepting connections and bind it to the socket referenced by the \fIsocket\fR argument\&.
 
38
.sp
 
39
The \fIendpoint\fR argument is a string consisting of two parts as follows: \fItransport\fR://\fIaddress\fR\&. The \fItransport\fR part specifies the underlying transport protocol to use\&. The meaning of the \fIaddress\fR part is specific to the underlying transport protocol selected\&.
 
40
.sp
 
41
The following transports are defined:
 
42
.PP
 
43
\fIinproc\fR
 
44
.RS 4
 
45
local in\-process (inter\-thread) communication transport, see
 
46
\fBzmq_inproc\fR(7)
 
47
.RE
 
48
.PP
 
49
\fIipc\fR
 
50
.RS 4
 
51
local inter\-process communication transport, see
 
52
\fBzmq_ipc\fR(7)
 
53
.RE
 
54
.PP
 
55
\fItcp\fR
 
56
.RS 4
 
57
unicast transport using TCP, see
 
58
\fBzmq_tcp\fR(7)
 
59
.RE
 
60
.PP
 
61
\fIpgm\fR, \fIepgm\fR
 
62
.RS 4
 
63
reliable multicast transport using PGM, see
 
64
\fBzmq_pgm\fR(7)
 
65
.RE
 
66
.sp
 
67
With the exception of \fIZMQ_PAIR\fR sockets, a single socket may be connected to multiple endpoints using \fIzmq_connect()\fR, while simultaneously accepting incoming connections from multiple endpoints bound to the socket using \fIzmq_bind()\fR\&. Refer to \fBzmq_socket\fR(3) for a description of the exact semantics involved when connecting or binding a socket to multiple endpoints\&.
 
68
.SH "RETURN VALUE"
 
69
.sp
 
70
The \fIzmq_bind()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&.
 
71
.SH "ERRORS"
 
72
.PP
 
73
\fBEINVAL\fR
 
74
.RS 4
 
75
The endpoint supplied is invalid\&.
 
76
.RE
 
77
.PP
 
78
\fBEPROTONOSUPPORT\fR
 
79
.RS 4
 
80
The requested
 
81
\fItransport\fR
 
82
protocol is not supported\&.
 
83
.RE
 
84
.PP
 
85
\fBENOCOMPATPROTO\fR
 
86
.RS 4
 
87
The requested
 
88
\fItransport\fR
 
89
protocol is not compatible with the socket type\&.
 
90
.RE
 
91
.PP
 
92
\fBEADDRINUSE\fR
 
93
.RS 4
 
94
The requested
 
95
\fIaddress\fR
 
96
is already in use\&.
 
97
.RE
 
98
.PP
 
99
\fBEADDRNOTAVAIL\fR
 
100
.RS 4
 
101
The requested
 
102
\fIaddress\fR
 
103
was not local\&.
 
104
.RE
 
105
.PP
 
106
\fBENODEV\fR
 
107
.RS 4
 
108
The requested
 
109
\fIaddress\fR
 
110
specifies a nonexistent interface\&.
 
111
.RE
 
112
.PP
 
113
\fBETERM\fR
 
114
.RS 4
 
115
The 0MQ
 
116
\fIcontext\fR
 
117
associated with the specified
 
118
\fIsocket\fR
 
119
was terminated\&.
 
120
.RE
 
121
.PP
 
122
\fBENOTSOCK\fR
 
123
.RS 4
 
124
The provided
 
125
\fIsocket\fR
 
126
was invalid\&.
 
127
.RE
 
128
.PP
 
129
\fBEMTHREAD\fR
 
130
.RS 4
 
131
No I/O thread is available to accomplish the task\&.
 
132
.RE
 
133
.SH "EXAMPLE"
 
134
.PP
 
135
\fBBinding a publisher socket to an in-process and a TCP transport\fR. 
 
136
.sp
 
137
.if n \{\
 
138
.RS 4
 
139
.\}
 
140
.nf
 
141
/* Create a ZMQ_PUB socket */
 
142
void *socket = zmq_socket (context, ZMQ_PUB);
 
143
assert (socket);
 
144
/* Bind it to a in\-process transport with the address \*(Aqmy_publisher\*(Aq */
 
145
int rc = zmq_bind (socket, "inproc://my_publisher");
 
146
assert (rc == 0);
 
147
/* Bind it to a TCP transport on port 5555 of the \*(Aqeth0\*(Aq interface */
 
148
rc = zmq_bind (socket, "tcp://eth0:5555");
 
149
assert (rc == 0);
 
150
.fi
 
151
.if n \{\
 
152
.RE
 
153
.\}
 
154
.sp
 
155
.SH "SEE ALSO"
 
156
.sp
 
157
\fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7)
 
158
.SH "AUTHORS"
 
159
.sp
 
160
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>\&.
 
161
.SH "NOTES"
 
162
.IP " 1." 4
 
163
sustrik@250bpm.com
 
164
.RS 4
 
165
\%mailto:sustrik@250bpm.com
 
166
.RE
 
167
.IP " 2." 4
 
168
martin@lucina.net
 
169
.RS 4
 
170
\%mailto:martin@lucina.net
 
171
.RE