ExaGridDba

tcptest.pl

Jul 18th, 2013
195
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.  
  7. use warnings;
  8. use strict;
  9. use IO::Socket::INET;
  10.  
  11. if ( @ARGV != 2 )
  12. {
  13.         die "usage: $0 host port";
  14. }
  15.  
  16. my ( $host, $port ) = @ARGV;
  17.  
  18. my $socket = new IO::Socket::INET (
  19.         PeerHost => $host,
  20.         PeerPort => $port,
  21.         Proto => 'tcp',
  22. ) or die "Connect $host:$port $!";
  23.  
  24. print "connected to $host:$port\n";
Advertisement
Add Comment
Please, Sign In to add comment