2 #include "Hello_Impl.h"
4 Hello_Impl::Hello_Impl (CORBA::ORB_ptr orb
, MessageLog
*log
)
5 : orb_ (CORBA::ORB::_duplicate (orb
))
11 Hello_Impl::say_hello (CORBA::Short count
)
13 this->logger_
->register_message_recv (count
);
17 Hello_Impl::shutdown ()
21 this->orb_
->shutdown (false);
23 catch (const CORBA::Exception
& ex
)
25 //FUZZ: disable check_for_lack_ACE_OS
26 ex
._tao_print_exception ("Exception caught in shutdown ():");
27 //FUZZ: enable check_for_lack_ACE_OS
31 MessageLog::MessageLog (int num
, bool sprs
)
37 this->sent_
= new int[this->expected_
];
38 this->rcvd_
= new int[this->expected_
];
41 for (i
= 0; i
< this->expected_
; i
++)
48 MessageLog::~MessageLog ()
50 delete [] this->sent_
;
51 delete [] this->rcvd_
;
55 MessageLog::register_message_send (int message_num
)
57 ACE_GUARD (ACE_Mutex
, ace_mon
, this->mutex_
);
58 if (0 <= message_num
&& message_num
< this->expected_
)
60 this->sent_
[message_num
]++;
76 MessageLog::register_message_recv (int message_num
)
78 ACE_GUARD (ACE_Mutex
, ace_mon
, this->mutex_
);
79 if (0 <= message_num
&& message_num
< this->expected_
)
81 this->rcvd_
[message_num
]++;
97 MessageLog::report_statistics ()
102 for (i
= 0; i
< this->expected_
; i
++)
104 lmco
+= this->sent_
[i
] - this->rcvd_
[i
];
106 if (this->sent_
[i
] > 1 && !this->supress_
)
108 ACE_DEBUG ((LM_DEBUG
,
109 "\nSENT message <<< %d >>> %d times",
113 if (this->rcvd_
[i
] > 1 && !this->supress_
)
115 ACE_DEBUG ((LM_DEBUG
,
116 "\nRECEIVED message <<< %d >>> %d times",
120 if (this->sent_
[i
] != this->rcvd_
[i
] && !this->supress_
)
122 ACE_DEBUG ((LM_DEBUG
,
123 "\nLOST message <<< %d >>> %d times",
124 i
, this->sent_
[i
] - this->rcvd_
[i
]));
128 if (this->overdoseS_
!= 0 && !this->supress_
)
130 ACE_DEBUG ((LM_DEBUG
,
131 "\nSent more than expected."));
134 if (this->overdoseR_
!= 0 && !this->supress_
)
136 ACE_DEBUG ((LM_DEBUG
,
137 "\nReceived more than expected."));