2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:l:h:"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
23 ACE_ERROR_RETURN ((LM_ERROR
,
30 // Indicates successful parsing of the command line
36 // 2 : _non_existent() returned false
37 // 3 : _non_existent() returned true
38 // 4 : CORBA::OBJECT_NOT_EXIST exception
39 // 5 : CORBA::TRANSIENT exception
41 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
46 CORBA::ORB_init (argc
, argv
);
48 if (parse_args (argc
, argv
) != 0)
51 CORBA::Object_var object
=
52 orb
->string_to_object (ior
);
54 Simple_Server_var server
=
55 Simple_Server::_narrow (object
.in ());
57 if (CORBA::is_nil (server
.in ()))
59 ACE_ERROR_RETURN ((LM_ERROR
,
60 "Object reference <%s> is nil.\n",
65 CORBA::Boolean non_existent
= server
->_non_existent ();
73 "client (%P) _non_existent() returned %d\n",
74 static_cast<int>(non_existent
) ));
78 catch (const CORBA::OBJECT_NOT_EXIST
& ex
)
80 ex
._tao_print_exception ("ERROR: Exception caught:");
83 catch (const CORBA::TRANSIENT
&)
87 catch (const CORBA::Exception
& ex
)
89 ex
._tao_print_exception ("ERROR: Exception caught:");