~ubuntu-branches/ubuntu/maverick/zeromq/maverick

« back to all changes in this revision

Viewing changes to man/man3/zmq_connect.3

  • Committer: Bazaar Package Importer
  • Author(s): Adrian von Bidder
  • Date: 2010-03-17 10:43:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100317104340-un1ne0oqe16w8eaq
Tags: 2.0.6beta.dfsg-1
* New upstream version.
  - Source doesn't include non-C/C++ language bindings anymore.
  - New versioning: 2.0.6 is official upstream version which is a beta.
* Repacked orig tar: removed non-free RFC documents (closes: #567513)
* Improved/corrected description and copyright file, added bzip2 build
  dependency.  Thanks to feedback from zeromq mailing list.
* Disable OpenPGM on non-x86 architectures (closes: #567848)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH zmq_connect 3 "" "(c)2007-2010 iMatix Corporation" "0MQ User Manuals"
2
 
.SH NAME
3
 
zmq_connect \- connect the socket to the specified peer
4
 
.SH SYNOPSIS
5
 
.B int zmq_connect (void *s, const char *addr);
6
 
.SH DESCRIPTION
7
 
The function connect socket
8
 
.IR s
9
 
to the peer identified by
10
 
.IR addr .
11
 
Actual semantics of the  command depend on the underlying transport mechanism,
12
 
however, in cases where peers connect in an asymetric manner,
13
 
.IR zmq_bind
14
 
should be called first,
15
 
.IR zmq_connect
16
 
afterwards. Formats of the
17
 
.IR addr
18
 
parameter are defined by individual transports. For a list of supported
19
 
transports have a look at
20
 
.IR zmq(7)
21
 
manual page.
22
 
 
23
 
Note that single socket can be connected (and bound) to
24
 
arbitrary number of peers using different transport mechanisms.
25
 
.SH RETURN VALUE
26
 
In case of success the function returns zero. Otherwise it returns -1 and
27
 
sets
28
 
.IR errno
29
 
to the appropriate value.
30
 
.SH ERRORS
31
 
.IP "\fBEPROTONOSUPPORT\fP"
32
 
unsupported protocol.
33
 
.IP "\fBENOCOMPATPROTO\fP"
34
 
protocol is not compatible with the socket type.
35
 
.SH EXAMPLE
36
 
.nf
37
 
void *s = zmq_socket (context, ZMQ_SUB);
38
 
assert (s);
39
 
int rc = zmq_connect (s, "inproc://my_publisher");
40
 
assert (rc == 0);
41
 
rc = zmq_connect (s, "tcp://server001:5555");
42
 
assert (rc == 0);
43
 
.fi
44
 
.SH SEE ALSO
45
 
.BR zmq_bind (3)
46
 
.BR zmq_socket (3)
47
 
.BR zmq (7)
48
 
.SH AUTHOR
49
 
Martin Sustrik <sustrik at 250bpm dot com>