1
.TH zmq_connect 3 "" "(c)2007-2010 iMatix Corporation" "0MQ User Manuals"
3
zmq_connect \- connect the socket to the specified peer
5
.B int zmq_connect (void *s, const char *addr);
7
The function connect socket
9
to the peer identified by
11
Actual semantics of the command depend on the underlying transport mechanism,
12
however, in cases where peers connect in an asymetric manner,
14
should be called first,
16
afterwards. Formats of the
18
parameter are defined by individual transports. For a list of supported
19
transports have a look at
23
Note that single socket can be connected (and bound) to
24
arbitrary number of peers using different transport mechanisms.
26
In case of success the function returns zero. Otherwise it returns -1 and
29
to the appropriate value.
31
.IP "\fBEPROTONOSUPPORT\fP"
33
.IP "\fBENOCOMPATPROTO\fP"
34
protocol is not compatible with the socket type.
37
void *s = zmq_socket (context, ZMQ_SUB);
39
int rc = zmq_connect (s, "inproc://my_publisher");
41
rc = zmq_connect (s, "tcp://server001:5555");
49
Martin Sustrik <sustrik at 250bpm dot com>