Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Big_Reply / Client_Task.cpp
blobe2c1a4c2aa20be4b4cf9e9bce32b182278061f29
2 #include "Client_Task.h"
5 Client_Task::Client_Task (Test::Big_Reply_ptr reply_gen,
6 int event_count,
7 ACE_Thread_Manager *thr_mgr)
8 : ACE_Task_Base (thr_mgr)
9 , reply_gen_ (Test::Big_Reply::_duplicate (reply_gen))
10 , event_count_ (event_count)
15 int
16 Client_Task::svc ()
18 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting client task\n"));
20 // Make the connections ..
21 this->validate_connection ();
23 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Starting big reply\n"));
26 // Now get the big replies..
27 try
29 for (int i = 0; i != this->event_count_; ++i)
31 Test::Octet_Seq_var dummy =
32 this->reply_gen_->get_big_reply ();
35 catch (const CORBA::Exception& ex)
37 ex._tao_print_exception ("Exception Caught\n");
38 return -1;
41 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client task finished\n"));
42 return 0;
45 void
46 Client_Task::validate_connection ()
48 ACE_DEBUG ((LM_DEBUG, "(%P|%t) Validating connection ..\n"));
51 // Try to setup a connection to the remote server, ignoring all the
52 // exceptions that are expected (see bug 189 on why it is so). We
53 // could use a a validate_connection for it . But we want this test
54 // to work with Minimum CORBA builds too..
55 for (int i = 0; i != 100; ++i)
57 try
59 this->reply_gen_->ping ();
61 catch (const CORBA::Exception&)