Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / tests / Bug_1361_Regression / Echo.cpp
blob0db0083ad0be725502b8894a547363b102a13173
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"
8 #include "ace/OS_NS_string.h"
9 #include "ace/OS_NS_signal.h"
11 Echo::Echo(CORBA::ORB_ptr orb,
12 int abort_counter)
13 : orb_(CORBA::ORB::_duplicate(orb))
14 , abort_counter_(abort_counter)
18 void
19 Echo::echo_payload(Test::Payload const &)
21 --this->abort_counter_;
23 if (this->abort_counter_ == 0)
25 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload, aborting\n"));
26 // Kill the app
27 ACE::terminate_process (ACE_OS::getpid ());
31 void
32 Echo::echo_payload_out (Test::Payload_out data)
34 int j = ACE_OS::rand() % 40000;
35 data = new Test::Payload(j);
36 data->length(j);
37 ACE_OS::memset(data->get_buffer(), 0, data->length());
39 --this->abort_counter_;
41 if (this->abort_counter_ == 0)
43 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload_out, aborting\n"));
44 // Kill the app
45 ACE::terminate_process (ACE_OS::getpid ());