1 #include "Client_Task.h"
2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
5 static int iterations
= 1000;
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("i:k:"));
13 while ((c
= get_opts ()) != -1)
17 iterations
= ACE_OS::atoi (get_opts
.opt_arg ());
20 ior
= 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
[])
41 CORBA::ORB_init (argc
, argv
);
43 if (parse_args (argc
, argv
) != 0)
46 CORBA::Object_var tmp
=
47 orb
->string_to_object(ior
);
49 Test::Sender_var sender
=
50 Test::Sender::_narrow(tmp
.in ());
52 if (CORBA::is_nil (sender
.in ()))
54 ACE_ERROR_RETURN ((LM_DEBUG
,
55 "Nil coordinator reference <%s>\n",
61 Client_Task
client_task (sender
.in (),
64 ACE_Thread_Manager::instance ());
66 if (client_task
.activate (THR_NEW_LWP
| THR_JOINABLE
, 8, 1) == -1)
68 ACE_ERROR ((LM_ERROR
, "Error activating client task\n"));
70 ACE_Thread_Manager::instance ()->wait ();
73 sender
->get_event_count ();
75 ACE_DEBUG ((LM_DEBUG
, "(%P) - Receiver got %d messages\n",
78 // shutdown the remote ORB
85 catch (const CORBA::Exception
& ex
)
87 ex
._tao_print_exception ("Exception caught:");