summaryrefslogtreecommitdiff
path: root/cpan/IO-Socket-IP
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-02-26 08:19:11 +0000
committerSteve Hay <steve.m.hay@googlemail.com>2014-02-26 08:19:11 +0000
commit1472fa3142752a63cd8ba4fe348df51f378213e6 (patch)
tree7d1e7f0b4ddaba7af2852db734d57c1744df3239 /cpan/IO-Socket-IP
parentf1d5d40b1056b2de9b1435e6046aeda21f818ded (diff)
downloadperl-1472fa3142752a63cd8ba4fe348df51f378213e6.tar.gz
Remove IO::Socket::IP examples as per Porting/Maintainers.pl
Diffstat (limited to 'cpan/IO-Socket-IP')
-rw-r--r--cpan/IO-Socket-IP/examples/connect.pl41
-rw-r--r--cpan/IO-Socket-IP/examples/nonblocking_libasyncns.pl73
2 files changed, 0 insertions, 114 deletions
diff --git a/cpan/IO-Socket-IP/examples/connect.pl b/cpan/IO-Socket-IP/examples/connect.pl
deleted file mode 100644
index 4a2b44bad9..0000000000
--- 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 8813b4a79a..0000000000
--- 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 );
- }
-}