Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / Bug_1482_Regression / Client_Task.cpp
blob75fc7db51f93a2ecfe54264fd261c4f127491532
2 #include "Client_Task.h"
3 #include "tao/Stub.h"
5 Client_Task::Client_Task (Test::Hello_ptr receiver,
6 CORBA::ORB_ptr o,
7 ACE_Thread_Manager *thr_mgr)
8 : ACE_Task_Base (thr_mgr)
9 , receiver_ (Test::Hello::_duplicate (receiver))
10 , handler_ (o)
11 , handler_var_ ()
12 , orb_ (CORBA::ORB::_duplicate (o))
14 this->handler_var_ = this->handler_._this ();
17 int
18 Client_Task::svc ()
20 // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n"));
22 try
24 for (CORBA::Long j = 0;
25 j != 1000;
26 ++j)
28 // Send 25 messages in every loop..
29 for (CORBA::Short i = 0; i != 25; ++i)
31 this->receiver_->sendc_next_prime (this->handler_var_.in ());
34 CORBA::Short repl = 0;
35 while (repl != 25)
37 CORBA::Boolean pending =
38 this->orb_->work_pending ();
40 if (pending)
42 this->orb_->perform_work ();
44 ++repl;
49 catch (const CORBA::Exception&)
51 return -1;
53 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
54 return 0;