diff options
-rw-r--r-- | Doc/library/socket.rst | 16 | ||||
-rw-r--r-- | Lib/socket.py | 2 | ||||
-rw-r--r-- | Lib/test/support/__init__.py | 1 |
3 files changed, 8 insertions, 11 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 800058b1af..b4a07bd5d5 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -597,9 +597,8 @@ The following functions all create :ref:`socket objects <socket-objects>`. .. function:: create_server(address, *, family=AF_INET, backlog=0, reuse_port=False, dualstack_ipv6=False) - Convenience function which creates a :data:`SOCK_STREAM` type socket - bound to *address* (a 2-tuple ``(host, port)``) and return the socket - object. + Convenience function which creates a TCP socket bound to *address* (a 2-tuple + ``(host, port)``) and return the socket object. *family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is the queue size passed to :meth:`socket.listen`; when ``0`` @@ -608,14 +607,13 @@ The following functions all create :ref:`socket objects <socket-objects>`. If *dualstack_ipv6* is true and the platform supports it the socket will be able to accept both IPv4 and IPv6 connections, else it will raise - :exc:`ValueError`. Most POSIX platforms are supposed to support this option. - When this option is enabled the address returned by :meth:`socket.getpeername` - when an IPv4 connection occurs will be an IPv6 address represented as an - IPv4-mapped IPv6 address. + :exc:`ValueError`. Most POSIX platforms and Windows are supposed to support + this functionality. + When this functionality is enabled the address returned by + :meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6 + address represented as an IPv4-mapped IPv6 address. If *dualstack_ipv6* is false it will explicitly disable this functionality on platforms that enable it by default (e.g. Linux). - For platforms not supporting this functionality natively you could use this - `MultipleSocketsListener recipe <https://code.activestate.com/recipes/578504/>`__. This parameter can be used in conjunction with :func:`has_dualstack_ipv6`: :: diff --git a/Lib/socket.py b/Lib/socket.py index 454691cc11..2e51cd16f3 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -777,7 +777,7 @@ def create_server(address, *, family=AF_INET, backlog=0, reuse_port=False, # 1) It's unnecessary: bind() will succeed even in case of a # previous closed socket on the same address and still in # TIME_WAIT state. - # 2) If set, another socket may be free to bind() on the same + # 2) If set, another socket is free to bind() on the same # address, effectively preventing this one from accepting # connections. Also, it may set the process in a state where # it'll no longer respond to any signals or graceful kills. diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 792ad3e8fe..5bd15a2fea 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2978,7 +2978,6 @@ def maybe_get_event_loop_policy(): """Return the global event loop policy if one is set, else return None.""" return asyncio.events._event_loop_policy - # Helpers for testing hashing. NHASHBITS = sys.hash_info.width # number of bits in hash() result assert NHASHBITS in (32, 64) |