Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / Single_Read / test_i.cpp
blobc066d4b7c033477e0dcc229ef2b777179a1e3f85
1 #include "test_i.h"
2 #include "ace/OS_NS_unistd.h"
4 test_i::test_i (CORBA::ORB_ptr orb, const ACE_TCHAR *file_name)
5 : orb_ (CORBA::ORB::_duplicate (orb)),
6 client_done_ (false),
7 client_done_file_(file_name)
11 void
12 test_i::method (CORBA::ULong request_number,
13 const test::data &)
15 ACE_DEBUG ((LM_DEBUG,
16 ACE_TEXT ("server: Iteration %d @ %T\n"),
17 request_number));
19 if (!client_done_)
21 FILE *input_file = ACE_OS::fopen (client_done_file_, "r");
22 if (input_file == 0)
24 // Time required to process this request.
25 ACE_Time_Value work_time (0,
26 3000 * 1000);
28 ACE_OS::sleep (work_time);
30 else
32 // The client is long gone because the run_test.pl has created
33 // the file to let us know. There's no need to keep on with
34 // these pointless sleeps
35 client_done_ = true;
36 ACE_OS::fclose (input_file);
41 void
42 test_i::shutdown ()
44 ACE_DEBUG ((LM_DEBUG,
45 "(%P|%t) About to invoke shudown... "));
46 this->orb_->shutdown (false);