Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Oneways_Invoking_Twoways / Client_Task.cpp
blob4e00819f0f535f369265d241010c2dd862428edc
2 #include "Client_Task.h"
3 #include "ace/OS_NS_unistd.h"
5 Client_Task::Client_Task (Test::Sender_ptr reply_gen,
6 Test::Receiver_ptr us,
7 ACE_Thread_Manager *thr_mgr,
8 Receiver_i * receiver_impl)
9 : ACE_Task_Base (thr_mgr)
10 , sender_(Test::Sender::_duplicate (reply_gen))
11 , us_ (Test::Receiver::_duplicate (us))
12 , receiver_impl_ (receiver_impl)
17 int
18 Client_Task::svc (void)
20 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n"));
22 try
24 for (int i = 0; i != 1; ++i)
26 ACE_DEBUG ((LM_DEBUG,
27 "TAO (%P|%t) sending oneways...\n"));
29 this->sender_->send_ready_message (this->us_.in ());
32 // sleeps are evil but 1 sec or so is an improvement on the minute plus
33 // this poorly implemented test used to take
34 while (this->receiver_impl_->no_calls_ < 10)
35 ACE_OS::sleep (1);
37 catch (const CORBA::Exception& ex)
39 ex._tao_print_exception ("Caught Exception");
40 return -1;
42 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
43 return 0;