-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtcpmclient_test1.pl
More file actions
executable file
·40 lines (37 loc) · 903 Bytes
/
Copy pathtcpmclient_test1.pl
File metadata and controls
executable file
·40 lines (37 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/local/bin/perl
require 'tcpmclient.pl';
if($0 eq __FILE__){
$port = 12345;
$host = "localhost";
$allsize = 100000;
$packetsize = 1000;
$conn = 5;
$checknum=3;
while($_=$ARGV[0]){
if(/^-P/){$port=$';}
elsif(/^-H/){$host=$';}
elsif(/^-C/){$conn=$';}
elsif(/^-S/){$allsize=$';}
else{print "syntax error\n";}
shift;
}
open(SAVEOUT,">&STDOUT") || die "can't reopen SAVEOUT:$!";
select(SAVEOUT);$|=1;select(STDOUT);$|=1;
close(STDOUT);
for($allsize=20000;$allsize<=100000;$allsize+=20000){
for($conn=1;$conn<=8;$conn++){
for($num=0;$num<$checknum;$num++){
sleep(1);
$ti = &tcpmclient($port,$host,$conn,$allsize);
$line = "$allsize\t$conn\t$ti";
print SAVEOUT "$line\n";
push(@results,$line);
}
}
}
open(STDOUT,">&SAVEOUT") || die "can't reopen STDOUT:$!";
foreach $line(@results){
print $line,"\n";
}
}
1;