Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / GIOP_Fragments / Java_Big_Reply / Client_Task.cpp
blob712826479b708a8e65c55898c4967ffecedade0f
2 #include "Client_Task.h"
4 Client_Task::Client_Task (Test::Big_Reply_ptr reply_gen,
5 int event_count,
6 ACE_Thread_Manager *thr_mgr)
7 : ACE_Task_Base (thr_mgr)
8 , reply_gen_ (Test::Big_Reply::_duplicate (reply_gen))
9 , event_count_ (event_count)
14 int
15 Client_Task::svc (void)
17 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n"));
20 // Now get the big replies..
21 try
23 for (int i = 0; i != this->event_count_; ++i)
25 Test::Octet_Seq_var seq =
26 this->reply_gen_->get_big_reply ();
28 CORBA::ULong length = seq->length ();
29 for(CORBA::ULong i = 0; i < length; ++i)
31 if (seq[i] != 'A')
33 ACE_ERROR_RETURN ((LM_ERROR,
34 "Invalid data '%c' at %d\n", seq[i], i),
35 -1);
39 // ACE_Time_Value tv(0, 10000000);
40 // ACE_OS::sleep(tv);
43 catch (const CORBA::Exception& ex)
45 ex._tao_print_exception ("Exception Caught\n");
46 return -1;
49 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
50 return 0;