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";
9 use PerlACE
::TestTarget
;
11 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
12 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
14 $server->AddLibPath ('../lib');
15 $client->AddLibPath ('../lib');
17 my $iorbase = "server.ior";
18 my $server_iorfile = $server->LocalFile ($iorbase);
19 my $client_iorfile = $client->LocalFile ($iorbase);
20 $server->DeleteFile($iorbase);
21 $client->DeleteFile($iorbase);
25 $mode = shift (@ARGV);
26 if ( $mode =~ /-dynamic/) {
27 $base_client_conf = "client_dynamic" . $PerlACE::svcconf_ext
;
28 $base_server_conf = "server_dynamic" . $PerlACE::svcconf_ext
;
29 $client_conf_file = $client->LocalFile ("$base_client_conf");
30 $server_conf_file = $server->LocalFile ("$base_server_conf");
32 elsif ( $mode =~ /-static/) {
33 $base_client_conf = "client_static" . $PerlACE::svcconf_ext
;
34 $base_server_conf = "server_static" . $PerlACE::svcconf_ext
;
35 $client_conf_file = $client->LocalFile ("$base_client_conf");
36 $server_conf_file = $server->LocalFile ("$base_server_conf");
39 print STDERR
"Unknown $mode. Specify -static or -dynamic\n";
43 if ($server->PutFile ($base_server_conf) == -1) {
44 print STDERR
"ERROR: cannot set file <$server_conf_file>\n";
47 if ($client->PutFile ($base_client_conf) == -1) {
48 print STDERR
"ERROR: cannot set file <$client_conf_file>\n";
52 $SV = $server->CreateProcess ("server",
53 "@ARGV -c 0 -ORBSvcConf $server_conf_file -o $server_iorfile");
55 $CL = $client->CreateProcess ("client",
56 "@ARGV -n 1 -ORBSvcConf $client_conf_file -k file://$client_iorfile");
60 if ($server->WaitForFileTimed ($iorbase,
61 $server->ProcessStartWaitInterval()) == -1) {
62 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
67 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
69 if ($client_status != 0) {
70 print STDERR
"$0: ERROR: client returned $client_status\n";
74 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
76 if ($server_status != 0) {
77 print STDERR
"$0: ERROR: server returned $server_status\n";
81 $server->DeleteFile($iorbase);
82 $client->DeleteFile($iorbase);