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
;
12 # Usually the primary component to run on targets (if any) is the server;
13 # this time it's the client.
14 my $client = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
15 my $server = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
17 my $iorbase = "server_on_localhost_1192.ior";
18 my $logfile = "client.log";
20 my $client_iorfile = $client->LocalFile($iorbase);
21 my $client_logfile = $client->LocalFile($logfile);
22 my $server_logfile = $server->LocalFile($logfile);
23 $client->DeleteFile($logfile);
25 ## Get the perl interpreter that invoked us and remove any
26 ## executable extension (if there is one).
29 $perl =~ s/000000\///g
if ($^O
eq 'VMS');
31 $SV = $server->CreateProcess ($perl, "fakeserver2.pl");
32 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile ".
34 "-ORBlogfile $client_logfile");
36 $SV->IgnoreExeSubDir(1);
37 $SV->IgnoreHostRoot(1);
39 $server_status = $SV->Spawn ();
41 sleep(1); # give the server a chance to come up
43 if ($server_status != 0) {
44 print STDERR
"ERROR: server returned $server_status\n";
48 if ($server->WaitForFileTimed ($iorbase,
49 $server->ProcessStartWaitInterval()) == -1) {
50 print STDERR
"ERROR: cannot find file <$iorbase>\n";
51 $SV->Kill (); $SV->TimedWait (1);
55 if ($client->PutFile ($iorbase) == -1) {
56 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
61 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
63 if ($client_status != 0) {
64 print STDERR
"ERROR: client returned $client_status\n";
68 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
70 if ($server_status != 0) {
71 print STDERR
"ERROR: server returned $server_status\n";
75 open (LOG
, $server_logfile) or die "Couldn't open server log file $server_logfile: $!\n";
77 $ccmsgfound = 1 if (/process_parsed_messages, received CloseConnection message/);
80 if (not $ccmsgfound) {
81 print STDERR
"ERROR: didn't find CloseConnection debug message in client log.\n";