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 $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
21 my $iorbase = "server.ior";
22 my $server_iorfile = $server->LocalFile ($iorbase);
23 my $client_iorfile = $client->LocalFile ($iorbase);
24 $server->DeleteFile($iorbase);
25 $client->DeleteFile($iorbase);
26 my $server_conf_base = "server$PerlACE::svcconf_ext";
27 my $server_conf = $server->LocalFile ($server_conf_base);
28 if ($server->PutFile ($server_conf_base) == -1) {
29 print STDERR
"ERROR: cannot set file <$server_conf_base>\n";
33 $endpoints = "-ORBEndpoint shmiop://12345 -ORBEndpoint iiop://:"
34 . PerlACE
::TestTarget
::RandomPort
(5000);
35 $debug_conf = "-ORBDebugLevel $debug_level";
36 $svc_conf = "-ORBSvcConf $server_conf";
38 $server_opts = "-o $server_iorfile $svc_conf $endpoints $debug_conf";
40 $SV = $server->CreateProcess ("server", $server_opts);
41 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile");
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR
"ERROR: server returned $server_status\n";
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
57 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
59 if ($client_status != 0) {
60 print STDERR
"ERROR: client returned $client_status\n";
64 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
66 if ($server_status != 0) {
67 print STDERR
"ERROR: server returned $server_status\n";
71 $server->DeleteFile($iorbase);
72 $client->DeleteFile($iorbase);