File: ttcp_loop.pl

package info (click to toggle)
libassa 3.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,084 kB
  • ctags: 2,323
  • sloc: cpp: 15,641; sh: 8,704; makefile: 372; perl: 51
file content (44 lines) | stat: -rw-r--r-- 1,269 bytes parent folder | download | duplicates (9)
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
41
42
43
44
#!/usr/bin/perl  -- # -*- perl -*-
#
###############################################################################
#
#                          ttcp_loop.pl
#
###############################################################################
#
# Name: ttcp_loop.pl
#
# Synopsis:
#          ttcp_loop.pl [test_name] [port] [count]
#
# Description:
#          Retart [test_name] program as ttcp server for [count] iterations.
#          ttcp program exits after each completed data transfer from 
#          the client. [count] is needed to run it in batch.
#
# Options:
#          [test_name] - either ttcp or ttcp_assa or other compliant 
#                        ttcp modification. The base should be ttcp.c
#                        for other implementations.
#
#          [port]      - listening port.
#
#          [count]     - maximum number of restart iterations.
#
# Author: Vladislav Grinchenko
# Date:   01/05/2000
#
###############################################################################

$usage = "USAGE: ttcp_loop.pl [test_name] [port] [count]\n";

die $usage unless $#ARGV+1 == 3;

$prog  = $ARGV[0];
$port  = $ARGV[1];
$count = $ARGV[2];

while ($count) {		# Suspend process waiting till it's done.
	system "$prog -r -fm -s -p $port"; 
	$count--;
}