1 #include "Client_Task.h"
4 Client_Task::Client_Task (const ACE_TCHAR
*ior
,
6 ACE_Thread_Manager
*thr_mgr
,
8 : ACE_Task_Base (thr_mgr
)
10 , corb_ (CORBA::ORB::_duplicate (corb
))
21 // Get an object reference from the argument string.
22 CORBA::Object_var tmp
=
23 this->corb_
->string_to_object (input_
);
25 // Try to narrow the object reference to a test reference.
26 test_var test
= test::_narrow (tmp
.in ());
27 if (CORBA::is_nil (test
.in ()))
29 ACE_ERROR_RETURN ((LM_DEBUG
,
30 "Nil Test::Hello reference <%s>\n",
35 CORBA::String_var ior
=
36 this->corb_
->object_to_string (test
.in ());
39 "\nConnecting to: %C\n\n",
43 CORBA::String_var the_string
= test
->get_string ();
44 if (ACE_OS::strcmp (the_string
.in (), "Hello there!") != 0)
46 ACE_ERROR ((LM_ERROR
, "(%P|%t) - Error, incorrect string returned <%C>\n",
51 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - OK , correct string returned <%C>\n",
55 catch (const CORBA::INTERNAL
&)
60 "OK: Client_Task Expected excep with "
61 "direct collocation received\n"));
67 "ERROR: Client_Task Unxpected exception with"
68 "thru_poa collocation received\n"));
75 catch (const CORBA::Exception
& ex
)
77 ex
._tao_print_exception ("Exception caught:");