more getaddrinfo weirdness

Steve Holden sholden at holdenweb.com
Thu Feb 27 05:37:36 EST 2003


"Trent Lloyd" <trent at irc-desk.net> wrote ...
> When a IPv4 address is returned, the address tuple contains 2 fields
> (address, port) but when an IPv6 address comes back it has 4 fields
> (address, port, 0, 0)
> 0 and 0 are obviously both 0 and i am unsure of there meanings
> Bit annoying when you try
> address, port = addr
>
> There doesnt seem to be any mention in the docs, am i missing something?
>
Well, most obviously the bit in the 2.3a2 docs that says """For AF_INET6
address family, a four-tuple (host, port, flowinfo, scopeid) is used, where
flowinfo and scopeid represents sin6_flowinfo and sin6_scope_id member in
struct sockaddr_in6 in C. For socket module methods, flowinfo and scopeid
can be omitted just for backward compatibility. Note, however, omission of
scopeid can cause problems in manipulating scoped IPv6 addresses. """

The above is quoted from

    http://www.python.org/doc/2.3a2/lib/module-socket.html

which doesn't seem like an unobvious place to look! You'll have to look
further into the C documentation on your system for further information, I
fear.

regards
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Register for PyCon now!            http://www.python.org/pycon/reg.html







More information about the Python-list mailing list