2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:v:"));
13 while ((c
= get_opts ()) != -1)
17 ior
= get_opts
.opt_arg ();
20 message_size
= ACE_OS::atoi (get_opts
.opt_arg ());
24 ACE_ERROR_RETURN ((LM_ERROR
,
31 // Indicates successful parsing of the command line
36 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
40 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
42 if (parse_args (argc
, argv
) != 0)
45 CORBA::Object_var tmp
= orb
->string_to_object(ior
);
47 ctest_var hello
= ctest::_narrow(tmp
.in ());
49 if (CORBA::is_nil (hello
.in ()))
51 ACE_ERROR_RETURN ((LM_DEBUG
,
52 "Nil Test::Hello reference <%s>\n",
57 ctest::UCSeq_var data
;
59 hello
->ctestfn(message_size
, data
.out ());
61 ACE_DEBUG ((LM_DEBUG
, "Received %d bytes\n", data
->length()));
67 catch (const CORBA::Exception
& ex
)
69 ex
._tao_print_exception ("Exception caught:");