2 * @file Client_Peer.cpp
4 * @author Carlos O'Ryan <coryan@atdesk.com>
6 #include "Client_Peer.h"
7 #include "Clock_Ticks.h"
8 #include "tao/ORB_Core.h"
9 #include "ace/Reactor.h"
11 class Crasher
: public ACE_Event_Handler
16 virtual int handle_timeout (ACE_Time_Value
const & current_time
,
20 Client_Peer::Client_Peer (CORBA::ORB_ptr orb
)
21 : orb_(CORBA::ORB::_duplicate(orb
))
26 Client_Peer::callme(Test::Peer_ptr callback
,
27 CORBA::ULong max_depth
,
28 Test::Payload
const &)
30 // ACE_DEBUG ((LM_DEBUG, "Received call, depth = %d\n", max_depth));
33 Test::Peer_var me
= this->_this ();
35 Test::Payload return_data
;
37 callback
->callme(me
.in(), max_depth
- 1, return_data
);
42 Client_Peer::crash(void)
44 Crasher
* crasher
= new Crasher
;
46 ACE_Time_Value
clk_tck (0, Clock_Ticks::get_usecs_per_tick ());
47 ACE_Reactor
* reactor
= this->orb_
->orb_core()->reactor();
48 reactor
->schedule_timer(crasher
, 0, clk_tck
);
52 Client_Peer::noop(void)
56 Crasher::Crasher(void)
61 Crasher::handle_timeout (ACE_Time_Value
const & ,
64 // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Performing intentional crash
66 // This tests hangs on OpenVMS when abort() is used.
67 // Also see Crashed_Callback test.
68 #if defined (ACE_OPENVMS)