Socket::GetAddrInfo::PP - Pure Perl emulation of getaddrinfo and getnameinfo using IPv4-only legacy resolvers
Socket::GetAddrInfo::PP
getaddrinfo
getnameinfo
Socket::GetAddrInfo attempts to provide the getaddrinfo and getnameinfo functions as specified by RFC 2553. Ideally this is done 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.
Socket::GetAddrInfo
gethostbyname
AF_INET
If the family hint is supplied, it must be AF_INET. Any other value will result in an error thrown by croak.
family
croak
The only supported flags hint values are AI_PASSIVE, AI_CANONNAME, AI_NUMERICSERV and AI_NUMERICHOST.
flags
AI_PASSIVE
AI_CANONNAME
AI_NUMERICSERV
AI_NUMERICHOST
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.
$addr
The only supported $flags values are NI_NUMERICHOST, NI_NUMERICSERV, NI_NAMEREQD and NI_DGRAM.
$flags
NI_NUMERICHOST
NI_NUMERICSERV
NI_NAMEREQD
NI_DGRAM
Paul Evans <leonerd@leonerd.org.uk>
To install Socket::GetAddrInfo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Socket::GetAddrInfo
CPAN shell
perl -MCPAN -e shell install Socket::GetAddrInfo
For more information on module installation, please visit the detailed CPAN module installation guide.