From 7b78ed9d604a5d78af65eefaa456e98854874b3d Mon Sep 17 00:00:00 2001 From: Ian Barber Date: Tue, 12 Jun 2012 15:46:26 +0100 Subject: [PATCH] Update bind and connect documentation for clarity Based on discussion with Steve O on the list, make the difference between bind and connect usage more clear, and add a note reflecting the fact that inproc must have bind before connect to reinforce the information in zmq_inproc. --- doc/zmq_bind.txt | 12 +++++++----- doc/zmq_connect.txt | 17 +++++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/doc/zmq_bind.txt b/doc/zmq_bind.txt index 1d7c2ff4..58bc4d80 100644 --- a/doc/zmq_bind.txt +++ b/doc/zmq_bind.txt @@ -29,11 +29,13 @@ The following transports are defined: 'tcp':: unicast transport using TCP, see linkzmq:zmq_tcp[7] 'pgm', 'epgm':: reliable multicast transport using PGM, see linkzmq:zmq_pgm[7] -With the exception of 'ZMQ_PAIR' sockets, a single socket may be connected to -multiple endpoints using _zmq_connect()_, while simultaneously accepting -incoming connections from multiple endpoints bound to the socket using -_zmq_bind()_. Refer to linkzmq:zmq_socket[3] for a description of the exact -semantics involved when connecting or binding a socket to multiple endpoints. +ZeroMQ sockets support one-to-many and many-to-one semantics. With the exception +of 'ZMQ_PAIR' sockets every ZeroMQ socket type supports being bound with +_zmq_bind()_ as a singular endpoint or connecting with _zmq_connect()_ as one +of many endpoints. This allows combinations such as 1 ZMQ_REP to 100 ZMQ_REP and +100 ZMQ_REQ to 1 ZMQ_REP socket connections. Refer to linkzmq:zmq_socket[3] for +a description of the exact semantics involved when connecting or binding a socket +to multiple endpoints. RETURN VALUE diff --git a/doc/zmq_connect.txt b/doc/zmq_connect.txt index 6ec56b01..eb5af872 100644 --- a/doc/zmq_connect.txt +++ b/doc/zmq_connect.txt @@ -29,15 +29,20 @@ The following transports are defined: 'tcp':: unicast transport using TCP, see linkzmq:zmq_tcp[7] 'pgm', 'epgm':: reliable multicast transport using PGM, see linkzmq:zmq_pgm[7] -With the exception of 'ZMQ_PAIR' sockets, a single socket may be connected to -multiple endpoints using _zmq_connect()_, while simultaneously accepting -incoming connections from multiple endpoints bound to the socket using -_zmq_bind()_. Refer to linkzmq:zmq_socket[3] for a description of the exact -semantics involved when connecting or binding a socket to multiple endpoints. +ZeroMQ sockets support one-to-many and many-to-one semantics. With the exception +of 'ZMQ_PAIR' sockets every ZeroMQ socket type supports being bound with +_zmq_bind()_ as a singular endpoint or connecting with _zmq_connect()_ as one +of many endpoints. This allows combinations such as 1 ZMQ_REP to 100 ZMQ_REP and +100 ZMQ_REQ to 1 ZMQ_REP socket connections. Refer to linkzmq:zmq_socket[3] for +a description of the exact semantics involved when connecting or binding a socket +to multiple endpoints. NOTE: The connection will not be performed immediately but as needed by 0MQ. Thus a successful invocation of _zmq_connect()_ does not indicate that a -physical connection was or can actually be established. +physical connection was or can actually be established. Because of this, for most +socket types the order in which a listening socket is bound and a connecting socket +is connected does not matter. However, for inproc:// scheme sockets, the zmq_bind() +must be executed before any sockets zmq_connect() to that endpoint RETURN VALUE