This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove IO::Socket::IP examples as per Porting/Maintainers.pl
authorSteve Hay <steve.m.hay@googlemail.com>
Wed, 26 Feb 2014 08:19:11 +0000 (08:19 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Wed, 26 Feb 2014 08:19:11 +0000 (08:19 +0000)
MANIFEST
cpan/IO-Socket-IP/examples/connect.pl [deleted file]
cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl [deleted file]

index 9fcb518..81cddf0 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1334,8 +1334,6 @@ cpan/IO-Compress/t/cz-14gzopen.t                  IO::Compress
 cpan/IO-Compress/t/globmapper.t                                IO::Compress
 cpan/IO-Socket-IP/Build.PL                             IO::Socket::IP
 cpan/IO-Socket-IP/Changes                              IO::Socket::IP
-cpan/IO-Socket-IP/examples/connect.pl                  IO::Socket::IP
-cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl   IO::Socket::IP
 cpan/IO-Socket-IP/lib/IO/Socket/IP.pm                  IO::Socket::IP
 cpan/IO-Socket-IP/LICENSE                              IO::Socket::IP
 cpan/IO-Socket-IP/Makefile.PL                          IO::Socket::IP
diff --git a/cpan/IO-Socket-IP/examples/connect.pl b/cpan/IO-Socket-IP/examples/connect.pl
deleted file mode 100644 (file)
index 4a2b44b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use IO::Poll;
-use IO::Socket::IP;
-use Socket qw( SOCK_STREAM );
-
-my $host    = shift @ARGV or die "Need HOST\n";
-my $service = shift @ARGV or die "Need SERVICE\n";
-
-my $socket = IO::Socket::IP->new(
-   PeerHost    => $host,
-   PeerService => $service,
-   Type        => SOCK_STREAM,
-) or die "Cannot connect to $host:$service - $@";
-
-printf STDERR "Connected to %s:%s\n", $socket->peerhost_service;
-
-my $poll = IO::Poll->new;
-
-$poll->mask( \*STDIN => POLLIN );
-$poll->mask( $socket => POLLIN );
-
-while(1) {
-   $poll->poll( undef );
-
-   if( $poll->events( \*STDIN ) ) {
-      my $ret = STDIN->sysread( my $buffer, 8192 );
-      defined $ret or die "Cannot read STDIN - $!\n";
-      $ret or last;
-      $socket->syswrite( $buffer );
-   }
-   if( $poll->events( $socket ) ) {
-      my $ret = $socket->sysread( my $buffer, 8192 );
-      defined $ret or die "Cannot read socket - $!\n";
-      $ret or last;
-      STDOUT->syswrite( $buffer );
-   }
-}
diff --git a/cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl b/cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl
deleted file mode 100644 (file)
index 8813b4a..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use Errno qw( EINPROGRESS );
-use IO::Poll;
-use IO::Socket::IP;
-use Net::LibAsyncNS;
-use Socket qw( SOCK_STREAM );
-
-my $host    = shift @ARGV or die "Need HOST\n";
-my $service = shift @ARGV or die "Need SERVICE\n";
-
-my $poll = IO::Poll->new;
-
-my $asyncns = Net::LibAsyncNS->new( 1 );
-my $asyncns_fh = $asyncns->new_handle_for_fd;
-
-my $q = $asyncns->getaddrinfo( $host, $service, { socktype => SOCK_STREAM } );
-
-$poll->mask( $asyncns_fh => POLLIN );
-
-while( !$q->isdone ) {
-   $poll->poll( undef );
-
-   if( $poll->events( $asyncns_fh ) ) {
-      $asyncns->wait( 0 );
-   }
-}
-
-$poll->mask( $asyncns_fh => 0 );
-
-my ( $err, @peeraddrinfo ) = $asyncns->getaddrinfo_done( $q );
-$err and die "getaddrinfo() - $!";
-
-my $socket = IO::Socket::IP->new(
-   PeerAddrInfo => \@peeraddrinfo,
-   Blocking     => 0,
-) or die "Cannot construct socket - $@";
-
-$poll->mask( $socket => POLLOUT );
-
-while(1) {
-   $poll->poll( undef );
-
-   if( $poll->events( $socket ) & POLLOUT ) {
-      last if $socket->connect;
-      die "Cannot connect - $!" unless $! == EINPROGRESS;
-   }
-}
-
-printf STDERR "Connected to %s:%s\n", $socket->peerhost_service;
-
-$poll->mask( \*STDIN => POLLIN );
-$poll->mask( $socket => POLLIN );
-
-while(1) {
-   $poll->poll( undef );
-
-   if( $poll->events( \*STDIN ) ) {
-      my $ret = STDIN->sysread( my $buffer, 8192 );
-      defined $ret or die "Cannot read STDIN - $!\n";
-      $ret or last;
-      $socket->syswrite( $buffer );
-   }
-   if( $poll->events( $socket ) ) {
-      my $ret = $socket->sysread( my $buffer, 8192 );
-      defined $ret or die "Cannot read socket - $!\n";
-      $ret or last;
-      STDOUT->syswrite( $buffer );
-   }
-}