[EMAIL PROTECTED] writes:

>>sockaddr_in and sockaddr_in6 carries needless baggage such as the
>>port number and the family.  There is no reason to cache all that.
> 
>       to me, they are not needless, it is easier when we carry them
>       together.

I can't believe extracting the address would be that hard.

>>The difference is that address_list_type specifies the type for all
>>the addresses, not just one.  Is it possible that the host name
>>lookup returns some addresses in IPv4 and some in IPv6?
> 
>       yes.  you can get mixture of output for a host name lookup.

Oh, ok.  Then the address-type needs to be the property returned by
address_list_copy_one.

>>Also, I really dislike the idea of using the socket types and
>>concepts in code that should only be concerned with host name
>>resolution.  The code in host.c should translate host names to
>>addresses.  The code in connect.c should copy those addresses into
>>socket structures.
> 
>       with IPv6-capable API host name resolution is done by
>       getaddrinfo(3) functions, not gethostbyname(3).  they return
>       sockaddrs, therefore it is more natural/easier to carry around
>       sockaddrs.

It sounds like a random implementation convenience in getaddrinfo.

Reply via email to