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
)
16 Client_Task::svc (void)
18 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Starting client task\n"));
22 this->validate_connections ();
24 for (int i
= 0; i
!= this->event_count_
; ++i
)
29 "(%P|%t) In iteration [%d] ....\n",
33 this->sender_
->get_data (this->event_size_
, pl
.out ());
36 catch (const CORBA::Exception
&)
40 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) Client task finished\n"));
46 Client_Task::validate_connections (void)
48 for (int i
= 0 ; i
!= 100; i
++)
52 this->sender_
->ping ();
55 catch (const CORBA::Exception
&){}