GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Socket::GetAddrInfo::Emul(3) User Contributed Perl Documentation Socket::GetAddrInfo::Emul(3)

"Socket::GetAddrInfo::Emul" - Pure Perl emulation of "getaddrinfo" and "getnameinfo" using IPv4-only legacy resolvers

"Socket::GetAddrInfo" attempts to provide the "getaddrinfo" and "getnameinfo" functions by some XS code that calls the real functions in libc. If for some reason this cannot be done; either there is no C compiler, or libc does not provide these functions, then they will be emulated using the legacy resolvers "gethostbyname", etc... These emulations are not a complete replacement of the real functions, because they only support IPv4 (the "AF_INET" socket family). In this case, the following restrictions will apply.

  • If the "family" hint is supplied, it must be "AF_INET". Any other value will result in an error thrown by "croak".
  • The only supported "flags" hint values are "AI_PASSIVE", "AI_CANONNAME", "AI_NUMERICSERV" and "AI_NUMERICHOST".

    The flags "AI_V4MAPPED" and "AI_ALL" are recognised but ignored, as they do not apply to "AF_INET" lookups. Since this function only returns "AF_INET" addresses, it does not need to probe the system for configured addresses in other families, so the "AI_ADDRCONFIG" flag is also ignored.

    Note that "AI_NUMERICSERV" is an extension not defined by RFC 2553, but is provided by most OSes. It is possible (though unlikely) that even the native XS implementation does not recognise this constant.

  • If the sockaddr family of $addr is anything other than "AF_INET", an error will be thrown with "croak".
  • The only supported $flags values are "NI_NUMERICHOST", "NI_NUMERICSERV", "NI_NOFQDN", "NI_NAMEREQD" and "NI_DGRAM".

This pure-perl emulation provides the IDN constants such as "AI_IDN" and "NI_IDN", but the "getaddrinfo" and "getnameinfo" functions will croak if passed these flags. This should allow a program to probe for their support, and fall back to some other behaviour instead.

Paul Evans <leonerd@leonerd.org.uk>
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.