diff options
author | Todd Rinaldo <toddr@cpan.org> | 2020-09-15 17:40:55 -0500 |
---|---|---|
committer | Todd Rinaldo <toddr@cpan.org> | 2020-09-15 19:38:18 -0500 |
commit | 8fa9c8df6550bca3290be5dea52bc871e9b6eb19 (patch) | |
tree | 4b6a7541ebfd41db6618f186914799eb9eff97e1 /cpan | |
parent | 4737eb086461114557478cd96ef0b839db56baf0 (diff) | |
download | perl-8fa9c8df6550bca3290be5dea52bc871e9b6eb19.tar.gz |
Update IO-Socket-IP to CPAN version 0.41
[DELTA]
0.41 2020-09-15 16:59
[CHANGES]
* Updated to `=head2 barename` documentation style
[BUGFIXES]
* Remember to declare configure_requires Module::Build
0.40 2020-09-15 16:41
[CHANGES]
* Don't ship a Makefile.PL
* Updated docs about `-register` option
[BUGFIXES]
* Ensure safety under default-strict (RT133322)
Diffstat (limited to 'cpan')
24 files changed, 85 insertions, 26 deletions
diff --git a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm index 5a5ee7d204..3158ef55ab 100644 --- a/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm +++ b/cpan/IO-Socket-IP/lib/IO/Socket/IP.pm @@ -1,17 +1,20 @@ # You may distribute under the terms of either the GNU General Public License # or the Artistic License (the same terms as Perl itself) # -# (C) Paul Evans, 2010-2015 -- leonerd@leonerd.org.uk +# (C) Paul Evans, 2010-2020 -- leonerd@leonerd.org.uk package IO::Socket::IP; + +use v5; +use strict; +use warnings; + # $VERSION needs to be set before use base 'IO::Socket' # - https://rt.cpan.org/Ticket/Display.html?id=92107 BEGIN { - $VERSION = '0.39'; + our $VERSION = '0.41'; } -use strict; -use warnings; use base qw( IO::Socket ); use Carp; @@ -96,11 +99,10 @@ falling back to IPv4-only on systems which don't. =head1 REPLACING C<IO::Socket> DEFAULT BEHAVIOUR -By placing C<-register> in the import list, L<IO::Socket> uses -C<IO::Socket::IP> rather than C<IO::Socket::INET> as the class that handles -C<PF_INET>. C<IO::Socket> will also use C<IO::Socket::IP> rather than -C<IO::Socket::INET6> to handle C<PF_INET6>, provided that the C<AF_INET6> -constant is available. +By placing C<-register> in the import list to C<IO::Socket::IP>, it will +register itself with L<IO::Socket> as the class that handles C<PF_INET>. It +will also ask to handle C<PF_INET6> as well, provided that constant is +available. Changing C<IO::Socket>'s default behaviour means that calling the C<IO::Socket> constructor with either C<PF_INET> or C<PF_INET6> as the @@ -167,7 +169,9 @@ sub import =cut -=head2 $sock = IO::Socket::IP->new( %args ) +=head2 new + + $sock = IO::Socket::IP->new( %args ) Creates a new C<IO::Socket::IP> object, containing a newly created socket handle according to the named arguments passed. The recognised arguments are: @@ -353,7 +357,9 @@ If the constructor fails, it will set C<$@> to an appropriate error message; this may be from C<$!> or it may be some other string; not every failure necessarily has an associated C<errno> value. -=head2 $sock = IO::Socket::IP->new( $peeraddr ) +=head2 new (one arg) + + $sock = IO::Socket::IP->new( $peeraddr ) As a special case, if the constructor is passed a single argument (as opposed to an even-sized list of key/value pairs), it is taken to be the value @@ -817,7 +823,9 @@ sub _unpack_sockaddr } } -=head2 ( $host, $service ) = $sock->sockhost_service( $numeric ) +=head2 sockhost_service + + ( $host, $service ) = $sock->sockhost_service( $numeric ) Returns the hostname and service name of the local address (that is, the socket address given by the C<sockname> method). @@ -840,19 +848,27 @@ sub sockhost_service $self->_get_host_service( $self->sockname, $numeric ? NI_NUMERICHOST|NI_NUMERICSERV : 0 ); } -=head2 $addr = $sock->sockhost +=head2 sockhost + + $addr = $sock->sockhost Return the numeric form of the local address as a textual representation -=head2 $port = $sock->sockport +=head2 sockport + + $port = $sock->sockport Return the numeric form of the local port number -=head2 $host = $sock->sockhostname +=head2 sockhostname + + $host = $sock->sockhostname Return the resolved name of the local address -=head2 $service = $sock->sockservice +=head2 sockservice + + $service = $sock->sockservice Return the resolved name of the local port number @@ -864,7 +880,9 @@ sub sockport { my $self = shift; scalar +( $self->_get_host_service( $self->sock sub sockhostname { my $self = shift; scalar +( $self->_get_host_service( $self->sockname, 0, NIx_NOSERV ) )[0] } sub sockservice { my $self = shift; scalar +( $self->_get_host_service( $self->sockname, 0, NIx_NOHOST ) )[1] } -=head2 $addr = $sock->sockaddr +=head2 sockaddr + + $addr = $sock->sockaddr Return the local address as a binary octet string @@ -872,7 +890,9 @@ Return the local address as a binary octet string sub sockaddr { my $self = shift; _unpack_sockaddr $self->sockname } -=head2 ( $host, $service ) = $sock->peerhost_service( $numeric ) +=head2 peerhost_service + + ( $host, $service ) = $sock->peerhost_service( $numeric ) Returns the hostname and service name of the peer address (that is, the socket address given by the C<peername> method), similar to the @@ -893,19 +913,27 @@ sub peerhost_service $self->_get_host_service( $self->peername, $numeric ? NI_NUMERICHOST|NI_NUMERICSERV : 0 ); } -=head2 $addr = $sock->peerhost +=head2 peerhost + + $addr = $sock->peerhost Return the numeric form of the peer address as a textual representation -=head2 $port = $sock->peerport +=head2 peerport + + $port = $sock->peerport Return the numeric form of the peer port number -=head2 $host = $sock->peerhostname +=head2 peerhostname + + $host = $sock->peerhostname Return the resolved name of the peer address -=head2 $service = $sock->peerservice +=head2 peerservice + + $service = $sock->peerservice Return the resolved name of the peer port number @@ -917,7 +945,9 @@ sub peerport { my $self = shift; scalar +( $self->_get_host_service( $self->peer sub peerhostname { my $self = shift; scalar +( $self->_get_host_service( $self->peername, 0, NIx_NOSERV ) )[0] } sub peerservice { my $self = shift; scalar +( $self->_get_host_service( $self->peername, 0, NIx_NOHOST ) )[1] } -=head2 $addr = $peer->peeraddr +=head2 peeraddr + + $addr = $peer->peeraddr Return the peer address as a binary octet string @@ -967,7 +997,9 @@ BEGIN { } } -=head2 $inet = $sock->as_inet +=head2 as_inet + + $inet = $sock->as_inet Returns a new L<IO::Socket::INET> instance wrapping the same filehandle. This may be useful in cases where it is required, for backward-compatibility, to @@ -1089,7 +1121,9 @@ If the C<...Host> argument is in this special form and the corresponding C<...Service> or C<...Port> argument is also defined, the one parsed from the C<...Host> argument will take precedence and the other will be ignored. -=head2 ( $host, $port ) = IO::Socket::IP->split_addr( $addr ) +=head2 split_addr + + ( $host, $port ) = IO::Socket::IP->split_addr( $addr ) Utility method that provides the parsing functionality described above. Returns a 2-element list, containing either the split hostname and port @@ -1125,7 +1159,9 @@ sub split_addr return ( $addr, undef ); } -=head2 $addr = IO::Socket::IP->join_addr( $host, $port ) +=head2 join_addr + + $addr = IO::Socket::IP->join_addr( $host, $port ) Utility method that performs the reverse of C<split_addr>, returning a string formed by joining the specified host address and port number. The host address diff --git a/cpan/IO-Socket-IP/t/00use.t b/cpan/IO-Socket-IP/t/00use.t index 082356a888..093fe8a89c 100644 --- a/cpan/IO-Socket-IP/t/00use.t +++ b/cpan/IO-Socket-IP/t/00use.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/01local-client-v4.t b/cpan/IO-Socket-IP/t/01local-client-v4.t index 7ab7156993..b9e53884cb 100644 --- a/cpan/IO-Socket-IP/t/01local-client-v4.t +++ b/cpan/IO-Socket-IP/t/01local-client-v4.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/02local-server-v4.t b/cpan/IO-Socket-IP/t/02local-server-v4.t index c0d349f573..88691532fc 100644 --- a/cpan/IO-Socket-IP/t/02local-server-v4.t +++ b/cpan/IO-Socket-IP/t/02local-server-v4.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/03local-cross-v4.t b/cpan/IO-Socket-IP/t/03local-cross-v4.t index 8cac72a95b..63c17fbb94 100644 --- a/cpan/IO-Socket-IP/t/03local-cross-v4.t +++ b/cpan/IO-Socket-IP/t/03local-cross-v4.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/04local-client-v6.t b/cpan/IO-Socket-IP/t/04local-client-v6.t index ae265f91c8..7770911b8e 100644 --- a/cpan/IO-Socket-IP/t/04local-client-v6.t +++ b/cpan/IO-Socket-IP/t/04local-client-v6.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/05local-server-v6.t b/cpan/IO-Socket-IP/t/05local-server-v6.t index bd33d41bdf..392078b273 100644 --- a/cpan/IO-Socket-IP/t/05local-server-v6.t +++ b/cpan/IO-Socket-IP/t/05local-server-v6.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/06local-cross-v6.t b/cpan/IO-Socket-IP/t/06local-cross-v6.t index 9618b9722a..d4f3bc30f9 100644 --- a/cpan/IO-Socket-IP/t/06local-cross-v6.t +++ b/cpan/IO-Socket-IP/t/06local-cross-v6.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/10args.t b/cpan/IO-Socket-IP/t/10args.t index 8d46861196..8361a50d83 100644 --- a/cpan/IO-Socket-IP/t/10args.t +++ b/cpan/IO-Socket-IP/t/10args.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/11sockopts.t b/cpan/IO-Socket-IP/t/11sockopts.t index 5b850924dd..e3bbd081f4 100644 --- a/cpan/IO-Socket-IP/t/11sockopts.t +++ b/cpan/IO-Socket-IP/t/11sockopts.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/12port-fallback.t b/cpan/IO-Socket-IP/t/12port-fallback.t index 78217e25db..bbf93d9ff9 100644 --- a/cpan/IO-Socket-IP/t/12port-fallback.t +++ b/cpan/IO-Socket-IP/t/12port-fallback.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/13addrinfo.t b/cpan/IO-Socket-IP/t/13addrinfo.t index 96fc5fc10c..30709f8586 100644 --- a/cpan/IO-Socket-IP/t/13addrinfo.t +++ b/cpan/IO-Socket-IP/t/13addrinfo.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/14fileno.t b/cpan/IO-Socket-IP/t/14fileno.t index 6ace1c6f27..6e9ae92317 100644 --- a/cpan/IO-Socket-IP/t/14fileno.t +++ b/cpan/IO-Socket-IP/t/14fileno.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/15io-socket.t b/cpan/IO-Socket-IP/t/15io-socket.t index 07472941a6..584ebfa87b 100644 --- a/cpan/IO-Socket-IP/t/15io-socket.t +++ b/cpan/IO-Socket-IP/t/15io-socket.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/16v6only.t b/cpan/IO-Socket-IP/t/16v6only.t index d900cd7ceb..792ca2f4f5 100644 --- a/cpan/IO-Socket-IP/t/16v6only.t +++ b/cpan/IO-Socket-IP/t/16v6only.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/17gai-flags.t b/cpan/IO-Socket-IP/t/17gai-flags.t index c5e53224bd..4072981e45 100644 --- a/cpan/IO-Socket-IP/t/17gai-flags.t +++ b/cpan/IO-Socket-IP/t/17gai-flags.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/18fdopen.t b/cpan/IO-Socket-IP/t/18fdopen.t index 20cbe46d47..d1a3cb6d1f 100644 --- a/cpan/IO-Socket-IP/t/18fdopen.t +++ b/cpan/IO-Socket-IP/t/18fdopen.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/19no-addrs.t b/cpan/IO-Socket-IP/t/19no-addrs.t index f26eff415a..cba44ca71d 100644 --- a/cpan/IO-Socket-IP/t/19no-addrs.t +++ b/cpan/IO-Socket-IP/t/19no-addrs.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/20subclass.t b/cpan/IO-Socket-IP/t/20subclass.t index 231bd52cab..f6ddbfff31 100644 --- a/cpan/IO-Socket-IP/t/20subclass.t +++ b/cpan/IO-Socket-IP/t/20subclass.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/21as-inet.t b/cpan/IO-Socket-IP/t/21as-inet.t index 2b8713d46f..96e7efbb82 100644 --- a/cpan/IO-Socket-IP/t/21as-inet.t +++ b/cpan/IO-Socket-IP/t/21as-inet.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/22timeout.t b/cpan/IO-Socket-IP/t/22timeout.t index a4c28b3af0..80dce45015 100644 --- a/cpan/IO-Socket-IP/t/22timeout.t +++ b/cpan/IO-Socket-IP/t/22timeout.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/30nonblocking-connect.t b/cpan/IO-Socket-IP/t/30nonblocking-connect.t index 518bd2ebd8..c5109df032 100644 --- a/cpan/IO-Socket-IP/t/30nonblocking-connect.t +++ b/cpan/IO-Socket-IP/t/30nonblocking-connect.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t b/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t index 8dc3ca05ea..d2be3f7ce7 100644 --- a/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t +++ b/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; diff --git a/cpan/IO-Socket-IP/t/99pod.t b/cpan/IO-Socket-IP/t/99pod.t index eb319fbf78..91b19f1dad 100644 --- a/cpan/IO-Socket-IP/t/99pod.t +++ b/cpan/IO-Socket-IP/t/99pod.t @@ -1,5 +1,6 @@ #!/usr/bin/perl +use v5; use strict; use warnings; |