Modified zmq_tcp(7) to emphasize wildcard interfaces

This commit is contained in:
Pieter Hintjens 2010-08-10 12:36:56 +02:00
parent b6cdd369e3
commit a12f446c4c

View File

@ -30,10 +30,10 @@ colon and the TCP port number to use.
An 'interface' may be specified by either of the following: An 'interface' may be specified by either of the following:
* The interface name as defined by the operating system. * The wildcard `*`, meaning all available interfaces.
* The primary IPv4 address assigned to the interface, in its numeric * The primary IPv4 address assigned to the interface, in its numeric
representation. representation.
* The wildcard `*`, meaning that the interface address is unspecified. * The interface name as defined by the operating system.
NOTE: Interface names are not standardised in any way and should be assumed to NOTE: Interface names are not standardised in any way and should be assumed to
be arbitrary and platform dependent. On Win32 platforms no short interface be arbitrary and platform dependent. On Win32 platforms no short interface
@ -124,15 +124,15 @@ EXAMPLES
-------- --------
.Assigning a local address to a socket .Assigning a local address to a socket
---- ----
/* TCP port 5555 on all available interfaces */
rc = zmq_bind(socket, "tcp://*:5555");
assert (rc == 0);
/* TCP port 5555 on the local loopback interface on all platforms */ /* TCP port 5555 on the local loopback interface on all platforms */
rc = zmq_bind(socket, "tcp://127.0.0.1:5555"); rc = zmq_bind(socket, "tcp://127.0.0.1:5555");
assert (rc == 0); assert (rc == 0);
/* TCP port 5555 on the first ethernet network interface on Linux */ /* TCP port 5555 on the first ethernet network interface on Linux */
rc = zmq_bind(socket, "tcp://eth0:5555"); rc = zmq_bind(socket, "tcp://eth0:5555");
assert (rc == 0); assert (rc == 0);
/* TCP port 5555 with an unspecified interface */
rc = zmq_bind(socket, "tcp://*:5555");
assert (rc == 0);
---- ----
.Connecting a socket .Connecting a socket