4 * @author Carlos O'Ryan <coryan@atdesk.com>
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
,
13 : orb_(CORBA::ORB::_duplicate(orb
))
14 , abort_counter_(abort_counter
)
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"));
27 ACE::terminate_process (ACE_OS::getpid ());
32 Echo::echo_payload_out (Test::Payload_out data
)
34 int j
= ACE_OS::rand() % 40000;
35 data
= new Test::Payload(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"));
45 ACE::terminate_process (ACE_OS::getpid ());