You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
502 B
Perl

#!/usr/bin/perl -w
use IO::Socket;
$port = 999;
$num_args = scalar( @ARGV );
$host = 'localhost';
print "Connecting to $host\n";
$client_socket = IO::Socket::INET->new(
PeerPort => $port,
PeerAddr => $host,
Proto => 'tcp',
Type => SOCK_STREAM )
or die "Cannot open socket: $!";
# Read data from server.
$msg = <$client_socket>;
print "Recieved message from server:\n";
print "$msg\n";
$client_socket->close();