펄 스크리트임
---------------------
#!/usr/bin/perl
# Test the max number of tcp connections a server can support
# $Id: testMaxCon.pl,v 1.1 2003/06/23 19:10:41 yudong Exp yudong $
# usage: testMaxCon.pl IP port
use IO::Socket::INET;
@ARGV == 2 or die "Usage: testMaxCon.pl svr_ip svr_port\n";
my ($ip, $port) = @ARGV;
my $i = 0;
do {
$i++;
$socket[$i] = IO::Socket::INET->new(PeerAddr => $ip,
PeerPort => $port,
Proto => "tcp",
Timeout => 6,
Type => SOCK_STREAM);
} while ($socket[$i]);
print "Max TCP connections supported for this client: ", $i-1, "\n";
## end of program
-------------------------------------------------- |