summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl
blob: 093cd2721a4008bf380a0af96ebf01b626d1e731 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

$tao_root = $ENV{TAO_ROOT};
# This is a Perl script that runs the Naming Service, client and servers

unshift @INC, '../../../../../bin';
require Process;
require Uniqueid;

# amount of delay between running the servers

$sleeptime = 6;

# variables for parameters

$nsport = 20000 + uniqueid ();
sub name_server
{
    my $args = "-ORBnameserviceport $nsport";
    my $prog = "$tao_root/orbsvcs/Naming_Service/Naming_Service "
	.$Process::EXE_EXT;
    print ("\nNaming_Service: $prog$Process::EXE_EXT $args\n");
    $NS = Process::Create ($prog, $args);
}


sub server
{
    my $args = "-ORBnameserviceport $nsport";
    print ("\nServer: server$Process::EXE_EXT $args\n");
    $SV = Process::Create ('.' . $DIR_SEPARATOR . "server " .$Process::EXE_EXT . $args);
}


sub client
{
    my $args = "-ORBnameserviceport $nsport";
    print ("\nclient: client $args\n");
    $CL = Process::Create ('.' . $DIR_SEPARATOR . "client " .$Process::EXE_EXT . $args);
}

name_server ();
sleep $sleeptime;

server ();
sleep $sleeptime;

client ();
$CL->Wait ();

$NS->Kill (); $NS->Wait ();
$SV->Kill (); $SV->Wait ();