1 #include "Client_Task.h"
2 #include "ace/Get_Opt.h"
5 const ACE_TCHAR
*ior
= ACE_TEXT ("file://test.ior");
6 bool server_shutdown
= false;
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:x"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
21 server_shutdown
= true;
25 ACE_ERROR_RETURN ((LM_ERROR
,
33 // Indicates successful parsing of the command line
38 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
43 CORBA::ORB_init (argc
, argv
);
45 if (parse_args (argc
, argv
) != 0)
48 CORBA::Object_var tmp
=
49 orb
->string_to_object (ior
);
51 Test::Big_Reply_var reply_gen
=
52 Test::Big_Reply::_narrow (tmp
.in ());
54 if (CORBA::is_nil (reply_gen
.in ()))
56 ACE_ERROR_RETURN ((LM_DEBUG
,
57 "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
, 4, 1) == -1)
68 ACE_ERROR ((LM_ERROR
, "Error activating client task\n"));
70 ACE_Thread_Manager::instance ()->wait ();
72 ACE_DEBUG ((LM_DEBUG
, "Got all the replies...\n"));
76 // Request the server to shutdown
77 reply_gen
->shutdown ();
82 catch (const CORBA::Exception
& ex
)
84 ex
._tao_print_exception ("Exception caught:");