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
;
19 my $client = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $server = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
23 my $iorbase = "test.ior";
24 my $thrserverfile = "thr_server.ior";
26 my $server_iorbase = $server->LocalFile ($iorbase);
27 my $client_iorbase = $client->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
30 $client->DeleteFile($iorbase);
32 my $server_thrserverfile = $server->LocalFile ($thrserverfile);
33 my $client_thrserverfile = $client->LocalFile ($thrserverfile);
34 $server->DeleteFile($thrserverfile);
35 $client->DeleteFile($thrserverfile);
37 $SV = $server->CreateProcess ("server",
38 "-ORBdebuglevel $debug_level " .
39 "-o $server_iorbase " .
40 "-i file://$server_thrserverfile");
42 $CL = $client->CreateProcess ("client",
43 "-ORBdebuglevel $debug_level " .
44 "-o $client_thrserverfile " .
45 "-i $client_iorbase");
47 $client_status = $CL->Spawn ();
49 if ($client_status != 0) {
50 print STDERR
"ERROR: client returned $client_status\n";
54 if ($client->WaitForFileTimed ($thrserverfile,
55 $client->ProcessStartWaitInterval()) == -1) {
56 print STDERR
"ERROR: cannot find file <$server_thrserverfile>\n";
57 $CL->Kill (); $CL->TimedWait (1);
61 if ($client->GetFile ($thrserverfile) == -1) {
62 print STDERR
"ERROR: cannot retrieve file <$client_thrserverfile>\n";
63 $CL->Kill (); $CL->TimedWait (1);
66 if ($server->PutFile ($thrserverfile) == -1) {
67 print STDERR
"ERROR: cannot set file <$server_thrserverfile>\n";
68 $CL->Kill (); $CL->TimedWait (1);
72 $server_status = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval() + 20);
74 if ($server_status != 0) {
75 print STDERR
"ERROR: client returned $server_status\n";
79 $client_status = $CL->WaitKill ($client->ProcessStopWaitInterval());
81 if ($client_status != 0) {
82 print STDERR
"ERROR: client returned $client_status\n";
86 $server->DeleteFile($iorbase);
87 $client->DeleteFile($iorbase);
89 $server->DeleteFile($thrserverfile);
90 $client->DeleteFile($thrserverfile);