Message382863
Shown in the session below is unexpected output of a 4-tuple from an AF_INET6 socket along with documentation that *suggests* to expect a 2-tuple. The phrasing "IP" might have to be toned down to "IPv4" or "AF_INET" to be accurate enough to avoid confusion.
Opinion: I think you should be explicit about the different behaviour for AF_INET6, so it is not reduced to a special/nut case for special interest groups. IPv6 has a hard enough time getting in; different formats for AF_INET and AF_INET6 should ideally be shown to all programmers, to at least avoid *uninformed* decisions to be incompatible with IPv6 while they develop on an IPv4 system (and the same in the opposite direction).
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> sox6 = socket.socket (socket.AF_INET6)
>>> sox6.getsockname ()
('::', 0, 0, 0)
>>> sox6.getsockname.__doc__
'getsockname() -> address info\n\nReturn the address of the local endpoint. For IP sockets, the address\ninfo is a pair (hostaddr, port).' |
|
Date |
User |
Action |
Args |
2020-12-11 11:49:59 | vanrein | set | recipients:
+ vanrein |
2020-12-11 11:49:59 | vanrein | set | messageid: <1607687399.41.0.179840129913.issue42620@roundup.psfhosted.org> |
2020-12-11 11:49:59 | vanrein | link | issue42620 messages |
2020-12-11 11:49:58 | vanrein | create | |
|