blob: 4b3b1ed632dbd905ecf9ea6f6ab6e4be4141fe11 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
// $Id$
#include "orbsvcs/Transport_Current/Transport_Current.h"
using namespace TAO;
/// Test referencing the TC data outside of the context of an upcall,
/// or a client-side interceptor
int
test_transport_current (Transport::Current_ptr tc
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
CORBA::UserException))
{
CORBA::Long id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
TAO::CounterT bs = tc->bytes_sent (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
TAO::CounterT br = tc->bytes_received (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
TAO::CounterT rs = tc->messages_sent (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
TAO::CounterT rr = tc->messages_received (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Tester (%P|%t) Transport [%q] - Sent/Received [bytes=%q/%q, messages=%q/%q]\n"),
(ACE_UINT64)id,
(ACE_UINT64)bs,
(ACE_UINT64)br,
(ACE_UINT64)rs,
(ACE_UINT64)rr));
return 0;
}
int
test_transport_current (CORBA::ORB_ptr orb
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
CORBA::UserException))
{
// Get the Current object.
CORBA::Object_var tcobject =
orb->resolve_initial_references ("TAO::Transport::Current"
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
Transport::Current_var tc =
Transport::Current::_narrow (tcobject.in ()
ACE_ENV_SINGLE_ARG_DECL);
ACE_TRY_CHECK;
if (CORBA::is_nil (tc.in ()))
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("(%P|%t) client - ERROR: Could not resolve ")
ACE_TEXT ("TAOTransportCurrent object.\n")));
ACE_TRY_THROW (CORBA::INTERNAL ());
}
return test_transport_current (tc.in ());
}
|