1 #include "tao/TransportCurrent/Transport_Current.h"
2 #include "tao/SystemException.h"
6 /// Test referencing the TC data outside of the context of an upcall,
7 /// or a client-side interceptor
10 test_transport_current (Transport::Current_ptr tc
)
12 CORBA::Long id
= tc
->id ();
14 TAO::CounterT bs
= tc
->bytes_sent ();
16 TAO::CounterT br
= tc
->bytes_received ();
18 TAO::CounterT rs
= tc
->messages_sent ();
20 TAO::CounterT rr
= tc
->messages_received ();
23 ACE_TEXT ("Tester (%P|%t) Transport [%q] - Sent/Received [bytes=%q/%q, messages=%q/%q]\n"),
34 test_transport_current (CORBA::ORB_ptr orb
)
36 // Get the Current object.
37 CORBA::Object_var tcobject
=
38 orb
->resolve_initial_references ("TAO::Transport::Current");
40 Transport::Current_var tc
=
41 Transport::Current::_narrow (tcobject
.in ());
43 if (CORBA::is_nil (tc
.in ()))
46 ACE_TEXT ("(%P|%t) client - ERROR: Could not resolve ")
47 ACE_TEXT ("TAOTransportCurrent object.\n")));
49 throw CORBA::INTERNAL ();
52 return test_transport_current (tc
.in ());