Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / Timed_Buffered_Oneways / test_i.cpp
blobffd86dd588ab4f61f36e9573883f7349a7afd2b0
1 #include "test_i.h"
2 #include "ace/OS_NS_unistd.h"
3 #include "ace/OS_NS_sys_time.h"
4 #include "ace/Time_Value.h"
6 test_i::test_i (CORBA::ORB_ptr orb)
7 : orb_ (CORBA::ORB::_duplicate (orb))
11 void
12 test_i::method (CORBA::ULong request_number,
13 CORBA::Long start_time,
14 const test::data &,
15 CORBA::ULong work)
17 ACE_Time_Value start (0);
18 start.msec (static_cast<long> (start_time));
19 ACE_DEBUG ((LM_DEBUG,
20 "server:\t%d took\t%dms\n",
21 request_number,
22 (ACE_OS::gettimeofday () - start).msec ()));
24 // Time required to process this request. <work> is time units in
25 // milli seconds.
26 ACE_Time_Value work_time (0, work * 1000);
28 ACE_OS::sleep (work_time);
31 void
32 test_i::flush ()
34 ACE_DEBUG ((LM_DEBUG, "server: got flush request\n"));
37 void
38 test_i::shutdown (CORBA::Long start_time)
40 ACE_Time_Value start (0);
41 start.msec (static_cast<long> (start_time));
42 ACE_DEBUG ((LM_DEBUG, "server: Shutting down... (%dms)\n",
43 (ACE_OS::gettimeofday() - start).msec ()));
44 this->orb_->shutdown (false);