Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Stack_Recursion / Client_Task.cpp
blob25f130a55453419f653a172ccb41241051859095
2 #include "Client_Task.h"
4 Client_Task::Client_Task (Test::Sender_ptr sender,
5 CORBA::Long event_count,
6 CORBA::ULong event_size,
7 ACE_Thread_Manager *thr_mgr)
8 : ACE_Task_Base (thr_mgr)
9 , sender_ (Test::Sender::_duplicate (sender))
10 , event_count_ (event_count)
11 , event_size_ (event_size)
15 int
16 Client_Task::svc (void)
18 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n"));
20 try
22 this->validate_connections ();
24 for (int i = 0; i != this->event_count_; ++i)
26 #if 0
27 if (i%100 == 0)
28 ACE_DEBUG ((LM_DEBUG,
29 "(%P|%t) In iteration [%d] ....\n",
30 i));
31 #endif /*if 0*/
32 Test::Payload_var pl;
33 this->sender_->get_data (this->event_size_, pl.out ());
36 catch (const CORBA::Exception&)
38 return -1;
40 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
41 return 0;
45 void
46 Client_Task::validate_connections (void)
48 for (int i = 0 ; i != 100; i++)
50 try
52 this->sender_->ping ();
55 catch (const CORBA::Exception&){}