1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
11 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
12 my $gateway = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $iorbase = "server.ior";
16 my $gwbase = "gateway.ior";
18 my $server_iorfile = $server->LocalFile ($iorbase);
19 my $server_gwfile = $server->LocalFile ($gwbase);
20 my $gateway_iorfile = $server->LocalFile ($iorbase);
21 my $gateway_gwfile = $server->LocalFile ($gwbase);
22 my $client_gwfile = $client->LocalFile ($gwbase);
24 $server->DeleteFile ($iorbase);
25 $server->DeleteFile ($gwbase);
26 $gateway->DeleteFile ($iorbase);
27 $gateway->DeleteFile ($gwbase);
28 $client->DeleteFile ($gwbase);
32 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
33 $GW = $gateway->CreateProcess ("gateway", "-k file://$gateway_iorfile -o $gateway_gwfile");
34 $CL = $client->CreateProcess ("client", "-k file://$client_gwfile -x -i 100");
36 $server_status = $SV->Spawn ();
38 if ($server_status != 0) {
39 print STDERR
"ERROR: server returned $server_status\n";
43 if ($server->WaitForFileTimed ($iorbase,
44 $server->ProcessStartWaitInterval()) == -1) {
45 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
46 $SV->Kill (); $SV->TimedWait (1);
52 if ($gateway->WaitForFileTimed ($gwbase,
53 $gateway->ProcessStartWaitInterval()) == -1) {
54 print STDERR
"ERROR: cannot find file <$gateway_gwfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
56 $GW->Kill (); $GW->TimedWait (1);
60 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
62 if ($client_status != 0) {
63 print STDERR
"ERROR: client returned $client_status\n";
67 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
69 if ($server_status != 0) {
70 print STDERR
"ERROR: server returned $server_status\n";
74 $gateway_status = $GW->WaitKill ($gateway->ProcessStopWaitInterval());
76 if ($gateway_status != 0) {
77 print STDERR
"ERROR: gateway returned $gateway_status\n";
81 $server->DeleteFile ($iorbase);
82 $server->DeleteFile ($gwbase);
83 $gateway->DeleteFile ($iorbase);
84 $gateway->DeleteFile ($gwbase);
85 $client->DeleteFile ($gwbase);