From 1472fa3142752a63cd8ba4fe348df51f378213e6 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Wed, 26 Feb 2014 08:19:11 +0000 Subject: [PATCH] Remove IO::Socket::IP examples as per Porting/Maintainers.pl --- MANIFEST | 2 - cpan/IO-Socket-IP/examples/connect.pl | 41 ------------ .../examples/nonblocking_libasyncns.pl | 73 ---------------------- 3 files changed, 116 deletions(-) delete mode 100644 cpan/IO-Socket-IP/examples/connect.pl delete mode 100644 cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl diff --git a/MANIFEST b/MANIFEST index 9fcb518..81cddf0 100644 --- 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 index 4a2b44b..0000000 --- a/cpan/IO-Socket-IP/examples/connect.pl +++ /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 index 8813b4a..0000000 --- a/cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl +++ /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 ); - } -} -- 2.7.4