2 * @file Server_Timer.cpp
4 * @author Carlos O'Ryan <coryan@atdesk.com>
6 #include "Server_Timer.h"
7 #include "ace/Reactor.h"
8 #include "ace/OS_NS_string.h"
10 Server_Timer::Server_Timer(Test::Echo_ptr echo
,
11 ACE_Reactor
* reactor
)
12 : ACE_Event_Handler (reactor
)
13 , echo_(Test::Echo::_duplicate(echo
))
18 Server_Timer::activate ()
20 ACE_Time_Value
tv (0, 20000);
21 this->reactor()->schedule_timer (this, 0, tv
);
25 Server_Timer::handle_timeout (ACE_Time_Value
const &, void const *)
27 Test::Payload
pload(1024);
30 ACE_OS::memset(pload
.get_buffer(), 0, pload
.length());
35 Test::Echo::_duplicate (this->echo_
.in());
37 if(CORBA::is_nil (echo
.in()))
40 echo
->echo_payload (pload
);
42 ACE_Time_Value
tv (0, 20000);
43 this->reactor()->schedule_timer (this, 0, tv
);
45 catch (const CORBA::Exception
&)
47 this->echo_
= Test::Echo::_nil ();
49 this->reactor()->cancel_timer(this);
58 Server_Timer::handle_close (ACE_HANDLE
, ACE_Reactor_Mask
)