3 #include "ace/Get_Opt.h"
6 ACE_TCHAR
const *orb1_args
= 0;
7 ACE_TCHAR
const *orb2_args
= 0;
10 parse_args (int argc
, ACE_TCHAR
*argv
[])
12 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT ("a:b:"));
15 while ((c
= get_opts ()) != -1)
19 orb1_args
= get_opts
.opt_arg ();
22 orb2_args
= get_opts
.opt_arg ();
26 ACE_ERROR_RETURN ((LM_ERROR
,
27 ACE_TEXT ("usage: %s ")
28 ACE_TEXT ("-a <orb1_args> ")
29 ACE_TEXT ("-b <orb2_args>")
34 // Indicates successful parsing of the command line
39 do_main (int argc
, ACE_TCHAR
*argv
[], orbs_check_callback check
)
43 if (parse_args (argc
, argv
) != 0)
45 ACE_ERROR_RETURN ((LM_ERROR
,
46 "ERROR: Cannot process args\n"),
50 ACE_ARGV
orb1_argv (orb1_args
);
51 int orb1_argc
= orb1_argv
.argc ();
53 ACE_ARGV
orb2_argv (orb2_args
);
54 int orb2_argc
= orb2_argv
.argc ();
57 "Initialize ORB instances...\n"));
60 CORBA::ORB_init (orb1_argc
, orb1_argv
.argv (), FIRST_ORB_NAME
);
63 CORBA::ORB_init (orb2_argc
, orb2_argv
.argv (), SECOND_ORB_NAME
);
66 "After ORB_init...\n"));
68 if (check
&& !check ())
70 ACE_ERROR_RETURN ((LM_ERROR
,
71 "ERROR: ORB check failed\n"),
75 catch (const CORBA::Exception
& ex
)
77 ex
._tao_print_exception ("Caught Exception in do_main:\n");