gh-129994: update docs when using dualstack_ipv6 in socket.create_server (#129996)

This commit is contained in:
Alexander Ershov 2025-03-30 15:19:36 +07:00 committed by GitHub
parent a175d64e30
commit 044a1e13d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -882,10 +882,10 @@ The following functions all create :ref:`socket objects <socket-objects>`.
, a default reasonable value is chosen. , a default reasonable value is chosen.
*reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option. *reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option.
If *dualstack_ipv6* is true and the platform supports it the socket will If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform
be able to accept both IPv4 and IPv6 connections, else it will raise supports it the socket will be able to accept both IPv4 and IPv6 connections,
:exc:`ValueError`. Most POSIX platforms and Windows are supposed to support else it will raise :exc:`ValueError`. Most POSIX platforms and Windows are
this functionality. supposed to support this functionality.
When this functionality is enabled the address returned by When this functionality is enabled the address returned by
:meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6 :meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6
address represented as an IPv4-mapped IPv6 address. address represented as an IPv4-mapped IPv6 address.