more getaddrinfo weirdness

Trent Lloyd trent at ztsoftware.net
Fri Feb 28 14:07:08 CET 2003


Hrm, my C(++) networking code appears to not even find this additonal information - let alone use it.

Unless its in the weird structure handling that protocol agnostic C code tends to entail (more casts than are healthy im sure)

Whats hte use of the scopeid and where do i pass it if i use it.
performing a connect() on the address seems to work just find (as well as creating the socket in the correct family etc)


On Thu, Feb 27, 2003 at 07:53:31PM -0500, Jp Calderone wrote:
> On Fri, Feb 28, 2003 at 08:42:59AM +0800, Trent Lloyd wrote:
> > 
> > ahh woopsy ;)
> > i Was looking under 'getaddrinfo' and not up the top
> > 
> > How can i handle easily unpacking these then without a case statement or 
> > somethign similar to distinguish v4/v6 addresses
> > 
> 
>   IPv6 isn't compatible with IPv4.  This is a design flaw in IPv6 and not
> Python's fault.  Generally, your network code needs to know if it is using
> IPv4 or IPv6.  If you really think you can ignore these additional fields,
> it is easy to do as...
> 
>     address, port = addrinfo[:2]
> 
>   Jp
> 
> -- 
>         "I quite agree with you," said the Duchess; "and the moral of
> that is -- Be what you would seem to be' -- or, if you'd like it put
> more simply -- Never imagine yourself not to be otherwise than what it
> might appear to others that what you were or might have been was not 
> otherwise than what you had been would have appeared to them to be
> otherwise.'"       -- Lewis Carrol, "Alice in Wonderland"
> -- 
>  up 19 days, 4:29, 5 users, load average: 0.18, 0.29, 0.40







More information about the Python-list mailing list