4 * @author Carlos O'Ryan <coryan@atdesk.com>
7 #include "tao/Messaging/Messaging.h"
8 #include "orbsvcs/CosNamingC.h"
12 ORB_Task::ORB_Task (CORBA::ORB_ptr orb
)
13 : orb_ (CORBA::ORB::_duplicate (orb
))
22 CORBA::Object_var ncRef
=
23 orb_
->string_to_object(
24 "corbaloc:iiop:10.175.12.99:15025/NameService" );
26 CORBA::PolicyList policies
;
28 TimeBase::TimeT timeout
= 5000 * 10000;
30 CORBA::Any timeoutAny
;
31 timeoutAny
<<= timeout
;
34 policies
[0] = orb_
->create_policy(
35 Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE
,
38 CORBA::Object_var object
= ncRef
->_set_policy_overrides(
39 policies
, CORBA::SET_OVERRIDE
);
41 policies
[0]->destroy();
43 CosNaming::NamingContext_var namingContext
=
44 CosNaming::NamingContext::_narrow( object
.in() );
45 namingContext
->_non_existent();
47 catch ( const CORBA::TRANSIENT
&)
49 ACE_DEBUG ((LM_DEBUG
, "Caught transient\n"));
51 catch ( const CORBA::TIMEOUT
&)
53 ACE_DEBUG ((LM_DEBUG
, "Caught timeout\n"));
55 catch ( const CORBA::Exception
& e
)
57 e
._tao_print_exception ("Exception caught");