Browse files

Remove use of Socket::GetAddrInfo.

Socket 2.001 (and possibly earlier) expose getaddrinfo() so we don't
need Socket::GetAddrInfo anymore.  Also, the author of that module
suggests that it's obsolete since Socket provides it now.
  • Loading branch information...
1 parent 4a415e5 commit 2a038120059176b412e51388ab1a6494c03a15d5 @rcaputo committed Jun 2, 2012
Showing with 20 additions and 20 deletions.
  1. +1 −1 dist.ini
  2. +17 −17 lib/POE/Component/Resolver.pm
  3. +1 −1 lib/POE/Component/Resolver/Sidecar.pm
  4. +1 −1 t/01-basic.t
View
2 dist.ini
@@ -6,7 +6,7 @@ copyright_holder = Rocco Caputo
[Prereqs]
POE = 1.311
Scalar::Util = 1.23
-Socket::GetAddrInfo = 0.22
+Socket = 2.001
Storable = 2.18
Test::More = 0.96
Time::HiRes = 1.9711
View
34 lib/POE/Component/Resolver.pm
@@ -6,8 +6,10 @@ use strict;
use POE qw(Wheel::Run Filter::Reference);
use Carp qw(croak carp);
use Time::HiRes qw(time);
-use Socket qw(unpack_sockaddr_in AF_INET AF_INET6);
-use Socket::GetAddrInfo qw(getnameinfo NI_NUMERICHOST NI_NUMERICSERV);
+use Socket qw(
+ unpack_sockaddr_in AF_INET AF_INET6
+ getnameinfo NI_NUMERICSERV NI_NUMERICHOST
+);
use POE::Component::Resolver::Sidecar;
@@ -574,13 +576,14 @@ POE::Component::Resolver - A non-blocking getaddrinfo() resolver
=head1 DESCRIPTION
-POE::Component::Resolver performs Socket::GetAddrInfo::getaddrinfo()
-calls in subprocesses where they're permitted to block as long as
-necessary.
+POE::Component::Resolver performs Socket::getaddrinfo() calls in
+subprocesses where they're permitted to block as long as necessary.
By default it will run eight subprocesses and prefer address families
-in whatever order Socket::GetAddrInfo returns them. These defaults
-can be overridden with constructor parameters.
+in whatever order getaddrinfo() returns them. These defaults can be
+overridden with constructor parameters. getaddrinfo() delegates to
+the operating system's resolver, which may be reconfigured according
+to the usual conventions.
=head2 PUBLIC METHODS
@@ -642,16 +645,14 @@ additional optional ones.
"host" and "service" are required and contain the host (name or
Internet address) and service (name or numeric port) that will be
-passed verbatim to getaddrinfo(). See L<Socket::GetAddrInfo> for
-details.
+passed verbatim to getaddrinfo(). See L<Socket> for details.
"event" is optional; it contains the name of the event that will
contain the resolver response. If omitted, it will default to
"resolver_response"; you may want to specify a shorter event name.
"hints" is optional. If specified, it must contain a hashref of hints
-exactly as getaddrinfo() expects them. See L<Socket::GetAddrInfo> for
-details.
+exactly as getaddrinfo() expects them. See L<Socket> for details.
"misc" is optional continuation data that will be passed back in the
response. It may contain any type of data the application requires.
@@ -700,8 +701,8 @@ In list context, it returns the numeric port and address.
}
unpack_addr() is a convenience wrapper around getnameinfo() from
-Socket::GetAddrInfo. You're certainly welcome to use the discrete
-function instead.
+L<Socket>. You're certainly welcome to use the discrete function
+instead.
unpack_addr() returns bleak emptiness on failure, regardless of
context. You can check for undef return.
@@ -712,10 +713,9 @@ context. You can check for undef return.
The resolver response event includes three parameters.
-$_[ARG0] and $_[ARG1] contain the retrn values from
-Socket::GetAddrInfo's getaddrinfo() call. These are an error message
-(if the call failed), and an arrayref of address structures if the
-call succeeded.
+$_[ARG0] and $_[ARG1] contain the retrn values from Socket's
+getaddrinfo() call. These are an error message (if the call failed),
+and an arrayref of address structures if the call succeeded.
The component provides its own error message, 'component shut down'.
This response is given for every pending request at the time the user
View
2 lib/POE/Component/Resolver/Sidecar.pm
@@ -5,7 +5,7 @@ use strict;
use Storable qw(nfreeze thaw);
-use Socket::GetAddrInfo qw(getaddrinfo);
+use Socket qw(getaddrinfo);
sub main {
my $buffer = "";
View
2 t/01-basic.t
@@ -17,7 +17,7 @@ my $r4 = POE::Component::Resolver->new(
# Try to detect whether we can resolve IPv6 addresses at all.
-use Socket::GetAddrInfo qw(getaddrinfo);
+use Socket qw(getaddrinfo);
my $has_ipv6 = do {
my ($error, @addresses) = getaddrinfo(
"ipv6.test-ipv6.com", "www", { family => AF_INET6 }

0 comments on commit 2a03812

Please sign in to comment.