Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / Bug_1551_Regression / Reply_Handler.cpp
blob0bb1faffc82b0c3c6567e87d325538deb4102cbe
1 #include "Reply_Handler.h"
3 Reply_Handler::Reply_Handler (
4 Test::Hello_ptr hello, CORBA::ORB_ptr orb)
5 : counter_(1000)
6 , hello_(Test::Hello::_duplicate(hello))
7 , orb_ (CORBA::ORB::_duplicate (orb))
11 void
12 Reply_Handler::short_sleep ()
14 check_counter();
16 Test::AMI_HelloHandler_var current =
17 _this();
19 hello_->sendc_short_sleep(current.in());
22 void
23 Reply_Handler::short_sleep_excep (
24 ::Messaging::ExceptionHolder *ex)
26 check_counter();
28 try
30 if (ex)
32 ex->raise_exception ();
34 else
36 // Problem with the exceptionholder, instead of crashing, print
37 // an error to the log, this normally shouldn't happen but when
38 // there is a bug in TAO it can happen :-(
39 ACE_ERROR ((LM_ERROR, "ERROR: Got nill exceptionholder\n"));
42 catch (const CORBA::Exception&)
44 // Exceptions are expected and thus ignored in normal runs:
45 #if 0
46 ex._tao_print_exception ("(%P|%t) Reply_Handler - caught exception:");
47 #endif /* 0 */
50 Test::AMI_HelloHandler_var current =
51 _this();
53 hello_->sendc_short_sleep(current.in());
56 void Reply_Handler::
57 check_counter()
59 long const count = --counter_;
60 if(count == 0)
62 // ACE_DEBUG((LM_DEBUG, "(%P|%t) Shut down client thread\n"));
63 orb_->shutdown(0);
64 return;
66 #if 0
67 if(count % 100 == 0)
69 ACE_DEBUG((LM_DEBUG, "(%P|%t) count = %d\n", count));
71 #endif /* 0 */