run_test.pl

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· PL 代码 · 共 69 行

PL
69
字号
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# run_test.pl,v 1.2 2003/07/24 18:18:31 pradeep Exp
# -*- perl -*-
#
#
use lib "../../../../bin";
use PerlACE::Run_Test;

$status = 0;
$startup_timeout = 60;
$experiment_timeout = 60;
$naming_ior = PerlACE::LocalFile ("naming.ior");
$server_flag_file = PerlACE::LocalFile ("server.flag");
$server_conf = PerlACE::LocalFile ("server.conf");
$client_conf = PerlACE::LocalFile ("client.conf");

$Naming = new PerlACE::Process ("../../../orbsvcs/Naming_Service/Naming_Service",
                                "-o $naming_ior");

$Activity_Client = new PerlACE::Process ("activity",
                                         "-ORBInitRef NameService=file://$naming_ior " .
                                         "-ORBSvcConf $client_conf");

$Activity_Server = new PerlACE::Process ("activity",
                                         "-ORBInitRef NameService=file://$naming_ior " .
                                         "-ORBSvcConf $server_conf " .
                                         "-Started_Flag $server_flag_file");

unlink $naming_ior;
unlink $server_flag_file;

print STDERR "Running Naming_Service\n";

$Naming->Spawn ();

if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
  print STDERR "ERROR: waiting for the naming service to start\n";
  $Naming->Kill ();
  exit 1;
}


print STDERR "Running Activity Server\n";
$Activity_Server->Spawn ();

if (PerlACE::waitforfile_timed ($server_flag_file, $startup_timeout) == -1) {
  print STDERR "ERROR: waiting for the server to start\n";
  $Activity_Server->Kill ();
  $Naming->Kill ();
  exit 1;
}

print STDERR "Running Activity Client\n";

$status = $Activity_Client->SpawnWaitKill ($experiment_timeout);

if ($status != 0)
  {
    print STDERR "ERROR: Client Activity returned $status\n";
  }

$Activity_Server->Kill ();
$Naming->Kill ();

exit $status;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?