Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Muxing / Client_Task.cpp
blob351c094666b988b1b34aeca6abf34d40627cb6bf
2 #include "Client_Task.h"
4 Client_Task::Client_Task (Test::Receiver_ptr receiver,
5 CORBA::Long event_count,
6 CORBA::ULong event_size,
7 ACE_Thread_Manager *thr_mgr)
8 : ACE_Task_Base (thr_mgr)
9 , receiver_ (Test::Receiver::_duplicate (receiver))
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"));
19 Test::Payload payload (this->event_size_);
20 payload.length (this->event_size_);
22 for (CORBA::ULong j = 0; j != payload.length (); ++j)
23 payload[j] = (j % 256);
25 try
27 for (int i = 0; i != this->event_count_; ++i)
29 this->receiver_->receive_data (payload);
32 catch (const CORBA::Exception&)
34 return -1;
36 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
37 return 0;