IO::Async::Resolver::LibAsyncNS - use libasyncns for IO::Async resolver queries
IO::Async::Resolver::LibAsyncNS
IO::Async
use IO::Async::Loop; use IO::Async::Resolver::LibAsyncNS; my $loop = IO::Async::Loop->new; my $resolver = IO::Async::Resolver::LibAsyncNS->new; $loop->add( $resolver ); $resolver->getaddrinfo( host => "metacpan.org", service => "http", socktype => "stream", )->on_done( sub { my @res = @_; print "metacpan.org available at\n"; printf " family=%d addr=%v02x\n", $_->{family}, $_->{addr} for @res; })->get;
This subclass of IO::Async::Resolver applies special handling to the getaddrinfo_hash and getnameinfo resolvers to use a Net::LibAsyncNS instance, rather than using the usual IO::Async::Function wrapper around the system resolver functions. This may lead to higher performance in some applications.
getaddrinfo_hash
getnameinfo
It provides no additional methods, configuration options or events besides those supported by IO::Async::Resolver itself. It exists purely to implement the same behaviours in a more efficient manner.
IO::Async::Resolver
Paul Evans <leonerd@leonerd.org.uk>
To install IO::Async::Resolver::LibAsyncNS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Async::Resolver::LibAsyncNS
CPAN shell
perl -MCPAN -e shell install IO::Async::Resolver::LibAsyncNS
For more information on module installation, please visit the detailed CPAN module installation guide.