1 #include "Client_Task.h"
2 #include "ace/Get_Opt.h"
4 static const ACE_TCHAR
*ior
= ACE_TEXT("file://server.ior");
5 static size_t nthreads
= 1;
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:n:"));
13 while ((c
= get_opts ()) != -1)
17 ior
= get_opts
.opt_arg ();
20 nthreads
= ACE_OS::atoi (get_opts
.opt_arg ());
24 ACE_ERROR_RETURN ((LM_ERROR
,
32 // Indicates successful parsing of the command line
37 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
42 CORBA::ORB_init (argc
, argv
);
44 if (parse_args (argc
, argv
) != 0)
47 CORBA::Object_var tmp
=
48 orb
->string_to_object(ior
);
50 Test::Big_Reply_var reply_gen
=
51 Test::Big_Reply::_narrow(tmp
.in ());
53 if (CORBA::is_nil (reply_gen
.in ()))
55 ACE_ERROR_RETURN ((LM_DEBUG
,
56 "Nil coordinator reference <%s>\n",
62 Client_Task
client_task (reply_gen
.in (),
64 ACE_Thread_Manager::instance ());
66 if (client_task
.activate (THR_NEW_LWP
| THR_JOINABLE
,
69 ACE_ERROR ((LM_ERROR
, "Error activating client task\n"));
71 ACE_Thread_Manager::instance ()->wait ();
73 reply_gen
->shutdown ();
77 catch (const CORBA::Exception
& ex
)
79 ex
._tao_print_exception ("Exception caught:");