> But why is that an attribute of a socket object?
Please pretend I did not write this. ;)
Anyway, getaddrinfo() on FreeBSD/Qemu gives this:
>>> socket.getaddrinfo('localhost', 21)
[(2, 2, 17, '', ('127.0.0.1', 21)), (2, 1, 6, '', ('127.0.0.1', 21)), (2, 5, 132, '', ('127.0.0.1', 21)), (28, 2, 17, '', ('::1', 21, 0, 0)), (28, 1, 6, '', ('::1', 21, 0, 0)), (28, 5, 132, '', ('::1', 21, 0, 0))]
>>> socket.getaddrinfo('localhost', 22)
[(2, 2, 17, '', ('127.0.0.1', 22)), (2, 1, 6, '', ('127.0.0.1', 22)), (2, 5, 132, '', ('127.0.0.1', 22)), (28, 2, 17, '', ('::1', 22, 0, 0)), (28, 1, 6, '', ('::1', 22, 0, 0)), (28, 5, 132, '', ('::1', 22, 0, 0))]
>>> socket.getaddrinfo('localhost', 80)
[(2, 2, 17, '', ('127.0.0.1', 80)), (2, 1, 6, '', ('127.0.0.1', 80)), (2, 5, 132, '', ('127.0.0.1', 80)), (28, 2, 17, '', ('::1', 80, 0, 0)), (28, 1, 6, '', ('::1', 80, 0, 0)), (28, 5, 132, '', ('::1', 80, 0, 0))] |