2 //=============================================================================
6 * This is a client implementation.
8 * @author Irfan Pyarali
10 //=============================================================================
13 #include "ace/Get_Opt.h"
15 #include "ace/OS_NS_string.h"
17 static const ACE_TCHAR
*IOR
= ACE_TEXT ("file://ior");
18 static int shutdown_server
= 0;
21 parse_args (int argc
, ACE_TCHAR
**argv
)
23 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:x"));
26 while ((c
= get_opts ()) != -1)
30 IOR
= get_opts
.opt_arg ();
39 ACE_ERROR_RETURN ((LM_ERROR
,
40 ACE_TEXT ("usage: %s ")
42 ACE_TEXT ("-x shutdown server ")
49 ACE_ERROR_RETURN ((LM_ERROR
,
50 ACE_TEXT ("Please specify the IOR\n")), -1);
56 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
61 CORBA::ORB_init (argc
, argv
);
63 int parse_args_result
=
64 parse_args (argc
, argv
);
65 if (parse_args_result
!= 0)
66 return parse_args_result
;
68 CORBA::Object_var object
=
69 orb
->string_to_object (IOR
);
72 test::_narrow (object
.in ());
81 test1
->destroy_POA ();
87 catch (const CORBA::Exception
&ex
)
90 ACE_TEXT ("caught expected %s\n"),
108 catch (const CORBA::Exception
& ex
)
110 ex
._tao_print_exception (ACE_TEXT ("Error!"));