@@ -70,6 +70,13 @@ created. Socket addresses are represented as follows:
70
70
notation like ``'daring.cwi.nl' `` or an IPv4 address like ``'100.50.200.5' ``,
71
71
and *port * is an integer.
72
72
73
+ - For IPv4 addresses, two special forms are accepted instead of a host
74
+ address: ``'' `` represents :const: `INADDR_ANY `, which is used to bind to all
75
+ interfaces, and the string ``'<broadcast>' `` represents
76
+ :const: `INADDR_BROADCAST `. This behavior is not compatible with IPv6,
77
+ therefore, you may want to avoid these if you intend to support IPv6 with your
78
+ Python programs.
79
+
73
80
- For :const: `AF_INET6 ` address family, a four-tuple ``(host, port, flowinfo,
74
81
scopeid) `` is used, where *flowinfo * and *scopeid * represent the ``sin6_flowinfo ``
75
82
and ``sin6_scope_id `` members in :const: `struct sockaddr_in6 ` in C. For
@@ -171,12 +178,6 @@ created. Socket addresses are represented as follows:
171
178
172
179
.. XXX document them!
173
180
174
- For IPv4 addresses, two special forms are accepted instead of a host address:
175
- the empty string represents :const: `INADDR_ANY `, and the string
176
- ``'<broadcast>' `` represents :const: `INADDR_BROADCAST `. This behavior is not
177
- compatible with IPv6, therefore, you may want to avoid these if you intend
178
- to support IPv6 with your Python programs.
179
-
180
181
If you use a hostname in the *host * portion of IPv4/v6 socket address, the
181
182
program may show a nondeterministic behavior, as Python uses the first address
182
183
returned from the DNS resolution. The socket address will be resolved
0 commit comments