=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tests / Bug_1269_Regression / Server_Timer.cpp
blob82a425e5e0bfe5994487aa2fc7fe26387227dd71
1 /**
2 * @file Server_Timer.cpp
4 * @author Carlos O'Ryan <coryan@atdesk.com>
5 */
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))
17 void
18 Server_Timer::activate ()
20 ACE_Time_Value tv (0, 20000);
21 this->reactor()->schedule_timer (this, 0, tv);
24 int
25 Server_Timer::handle_timeout (ACE_Time_Value const &, void const *)
27 Test::Payload pload(1024);
28 pload.length(1024);
30 ACE_OS::memset(pload.get_buffer(), 0, pload.length());
32 try
34 Test::Echo_var echo =
35 Test::Echo::_duplicate (this->echo_.in());
37 if(CORBA::is_nil (echo.in()))
38 return 0;
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);
51 return -1;
54 return 0;
57 int
58 Server_Timer::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
60 delete this;
61 return 0;