Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_1269_Regression / Echo.cpp
blob8ad66939d086dda1fea3809718ea876a9cd4aa3f
1 /**
2 * @file Echo.cpp
4 * @author Carlos O'Ryan <coryan@atdesk.com>
5 */
6 #include "Echo.h"
7 #include "ace/OS_NS_unistd.h"
9 Echo::Echo(CORBA::ORB_ptr orb,
10 int abort_counter)
11 : orb_(CORBA::ORB::_duplicate(orb))
12 , abort_counter_(abort_counter)
16 void
17 Echo::echo_payload(Test::Payload const &)
19 this->abort_counter_--;
21 if (this->abort_counter_ == 0)
23 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload, sleeping\n"));
24 // Sleep for 15 seconds, forcing a flow control of some kind.
25 ACE_OS::sleep(15);
27 // Run the ORB for a while, to generate a short-lived release of
28 // the flow control.
29 ACE_Time_Value tv(0, 10000);
30 this->orb_->run(tv);
32 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload, aborting\n"));
33 // Kill the app
34 ACE_OS::abort();