|
Boost : |
From: Michel André (michel.andre_at_[hidden])
Date: 2002-11-26 13:40:31
> > 1. getaddrinfo is thread-safe. And not all OS provide those
> > functions like gethostbyname_r
> >
> > 2. getaddrinfo resovle one name to multiaddresses, especially a
> > name with both IPv4 addresses, and IPv6 addresses.
>
> Just as a side note. getaddrinfo is only supported on Windows XP and
> above, no 95/98/Me/NT/2000.
yes thats true!
The implementation should use gethostbyname if getaddrinfo is not supported.
Actually its supported on some later service packs. And I guess the
implementation would have to resort to finding the existence og getaddrinfo
dynamically (via LoadLibrary and GetProcAddress on ws2_32.dll) and resort to
gethostbyname if it's not found. gethostbyname is thread safe in winsock as
one structure is allocated per thread. I don't know about the support for
getaddrinfo on other platforms or the existence of threadsafe versions.
Regards
/Michel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk