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 $options = "csd|ssliop|ssliop-csd";
20 my $ssliop_conf = "ssliop.conf";
21 my $csd_conf = "csd.conf";
22 my $ssliop_csd_conf = "ssliop-csd.conf";
23 my $client_conf = "client1.conf";
25 my $serv_opts = "-ORBSvcConf $ssliop_conf";
26 my $client_opts = "-ORBSvcConf $client_conf";
30 if (($ARGV[0] =~ /\-h/) || ($ARGV[0] =~ /\-\?/)) {
31 print $0. " $options\n";
32 } elsif ($ARGV[0] =~ /ssliop\-csd/) {
33 $serv_opts = "-ORBSvcConf $ssliop_csd_conf";
34 } elsif ($ARGV[0] =~ /csd/) {
35 $serv_opts = "-ORBSvcConf $csd_conf";
38 print "Using default ssliop configuration.\n";
41 print "Using default ssliop configuration.\n";
44 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
45 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
47 $ENV{'SSL_CERT_FILE'} = "cacert.pem";
48 my $iorbase = "Messenger.ior";
49 my $server_iorfile = $server->LocalFile ($iorbase);
50 my $client_iorfile = $client->LocalFile ($iorbase);
51 $server->DeleteFile($iorbase);
52 $client->DeleteFile($iorbase);
54 $SV = $server->CreateProcess ("MessengerServer", "-ORBdebuglevel $debug_level -o $server_iorfile $serv_opts");
55 $CL = $client->CreateProcess ("MessengerClient", "-k file://$client_iorfile $client_opts");
57 print STDERR
"\n\nSecurity Unaware Application Examples\n";
58 print STDERR
"-------------------------------------\n";
59 print STDERR
"Starting Messenger Server...\n\n";
61 print $SV->CommandLine(). "\n";
63 $server_status = $SV->Spawn ();
65 if ($server_status != 0) {
66 print STDERR
"ERROR: server returned $server_status\n";
70 if ($server->WaitForFileTimed ($iorbase,
71 $server->ProcessStartWaitInterval()) == -1) {
72 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
73 $SV->Kill (); $SV->TimedWait (1);
77 if ($server->GetFile ($iorbase) == -1) {
78 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
79 $SV->Kill (); $SV->TimedWait (1);
82 if ($client->PutFile ($iorbase) == -1) {
83 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
84 $SV->Kill (); $SV->TimedWait (1);
88 print $CL->CommandLine(). "\n";
89 print STDERR
"\nStarting MessengerClient, example 3...\n\n";
91 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
93 if ($client_status != 0) {
94 print STDERR
"ERROR: client returned $client_status\n";
98 $ENV{'SSL_CERT_FILE'} = "";
100 $server_status = $SV->Kill ();
102 if ($server_status != 0) {
103 print STDERR
"ERROR: server returned $server_status\n";
107 $server->DeleteFile($iorbase);
108 $client->DeleteFile($iorbase);