2 #include "ace/OS_NS_unistd.h"
3 #include "ace/High_Res_Timer.h"
5 ACE_High_Res_Timer sleep_duration
;
8 Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb
)
9 : orb_ (CORBA::ORB::_duplicate (orb
))
11 sleep_duration
.calibrate();
15 Simple_Server_i::echo (CORBA::Long x
,
18 ACE_Time_Value
tv (msecs
/ 1000, (msecs
% 1000) * 1000);
20 ACE_DEBUG ((LM_DEBUG
, "server (%P) will request sleep for %d sec and %d msecs.\n",
21 tv
.sec(), tv
.msec ()));
23 sleep_duration
.reset();
24 sleep_duration
.start();
26 sleep_duration
.stop();
28 sleep_duration
.elapsed_microseconds(usec
);
29 ACE_DEBUG ((LM_DEBUG
, "server (%P) actually slept for %d sec and %d msecs.\n",
30 usec
/1000000, (usec
% 1000000)/1000));
36 Simple_Server_i::shutdown ()
39 "server (%P) Received shutdown request from client\n"));
40 this->orb_
->shutdown (false);