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";
22 my $iorbase = "ior"; # please note that conf file is defined in *.conf file
23 my $client_conffile = $client->LocalFile ("client"."$PerlACE::svcconf_ext");
24 my $server_iorfile = $server->LocalFile ($iorbase);
25 my $client_iorfile = $client->LocalFile ($iorbase);
26 $server->DeleteFile($iorbase);
27 $client->DeleteFile($iorbase);
29 # Generate svc.conf file for server
30 my $server_conf = "svc.conf";
31 $server->LocalFile ($server_conf);
33 die "Error: Cannot create svc.conf file" if not open(FH
, ">$server_conf");
34 print FH
"# Define a special Reactor for single-threaded configurations. " .
35 " Refer to README for details. \n";
36 print FH
"dynamic Resource_Factory Service_Object * Time_Date:_make_My_Resource_Factory()\n";
37 print FH
"# Dynamically configure the ORB into the application process.\n";
38 print FH
"dynamic ORB Service_Object * Time_Date:_make_DLL_ORB() \"dummy\"\n";
39 print FH
"# Once the ORB is configured, dynamically configure the Time_Date service.\n";
40 print FH
"dynamic Time_Date_Servant Service_Object * Time_Date:_make_Time_Date_Servant() " .
41 "\"dummy -n ORB -o $server_iorfile\"\n";
44 if ($server->PutFile ($server_conf) == -1) {
45 print STDERR
"ERROR: cannot set file <$server_conf\n";
49 $SV = $server->CreateProcess ("server", "");
50 $CL = $client->CreateProcess ("client", "-f $client_iorfile -x -ORBSvcConf $client_conffile");
51 $server_status = $SV->Spawn ();
53 if ($server_status != 0) {
54 print STDERR
"ERROR: server returned $server_status\n";
58 if ($server->WaitForFileTimed ($iorbase,
59 $server->ProcessStartWaitInterval()) == -1) {
60 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
65 if ($server->GetFile ($iorbase) == -1) {
66 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
71 if ($client->PutFile ($iorbase) == -1) {
72 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
73 $SV->Kill (); $SV->TimedWait (1);
77 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
79 if ($client_status != 0) {
80 print STDERR
"ERROR: client returned $client_status\n";
84 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
86 if ($server_status != 0) {
87 print STDERR
"ERROR: server returned $server_status\n";
91 $server->DeleteFile ($server_conf);
92 $server->DeleteFile($iorbase);
93 $client->DeleteFile($iorbase);