1 #include "Client_Task.h"
2 #include "ace/Get_Opt.h"
4 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
5 bool shutdown_srv
= false;
8 parse_args (int argc
, ACE_TCHAR
*argv
[])
10 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:x"));
13 while ((c
= get_opts ()) != -1)
17 ior
= 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::Receiver_var receiver
=
51 Test::Receiver::_narrow(tmp
.in ());
53 if (CORBA::is_nil (receiver
.in ()))
55 ACE_ERROR_RETURN ((LM_DEBUG
,
56 "Nil coordinator reference <%s>\n",
63 receiver
->shutdown ();
67 Client_Task
client_task (receiver
.in (),
70 ACE_Thread_Manager::instance ());
72 if (client_task
.activate (THR_NEW_LWP
| THR_JOINABLE
, 4, 1) == -1)
74 ACE_ERROR ((LM_ERROR
, "Error activating client task\n"));
76 ACE_Thread_Manager::instance ()->wait ();
78 CORBA::Long count
= receiver
->get_event_count ();
80 ACE_DEBUG ((LM_DEBUG
, "(%P) - Receiver got %d messages\n",
85 catch (const CORBA::Exception
& ex
)
87 ex
._tao_print_exception ("Exception caught:");