Advertisement
ExaGridDba

tcptest.pl

Jul 18th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.42 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. # tcptest.pl
  4. # Brian Fitzgerald
  5. # 7/17/2013
  6. # brian@exagriddba.com
  7.  
  8. use warnings;
  9. use strict;
  10. use IO::Socket::INET;
  11.  
  12. if ( @ARGV != 2 )
  13. {
  14.         die "usage: $0 host port";
  15. }
  16.  
  17. my ( $host, $port ) = @ARGV;
  18.  
  19. my $socket = new IO::Socket::INET (
  20.         PeerHost => $host,
  21.         PeerPort => $port,
  22.         Proto => 'tcp',
  23. ) or die "Connect $host:$port $!";
  24.  
  25. print "connected to $host:$port\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement