#!/usr/local/bin/perl

$| = 1;

$port = 8443;
$trials    =   5;
@targets   = ( "soco.lcs.mit.edu" ) ;
@durations = ( 5, 10, 20 );
@windows   = (  10, 20, 50 );



foreach $target ( @targets ) {
    foreach $duration ( @durations ) {
	foreach $window ( @windows ) {
	    print "Duration: $duration sec  Concurrency: $window  Trials: $trials\n";

	    print STDOUT "Name      bytes        usec       MB/s" 
		. "   Succ   Attm     Succ     Attm\n";
	    print STDOUT "                                      " 
		. "  plays  plays  plays/s  plays/s\n";


	    for ($trial = 0; $trial < $trials; $trial++ ) {
		system "/disk/pu0/fubob/build/devel/maxssl_cps -n $window -t $duration -r 1 $target $port";
		
		
		while ( `netstat -n -a | grep TIME_WAIT | wc -l` > 500) {
		    sleep 5;
		}
		
	    }
	}
    }
}


