Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Security / MT_SSLIOP / Client_Worker.cpp
blob3f01c998b92069d8867eb6141523953bd038b1fa
1 #include "Client_Worker.h"
2 #include "tao/debug.h"
4 Client_Worker::Client_Worker (Simple_Server_ptr server,
5 Another_One_ptr another,
6 int niterations)
7 : server_ (Simple_Server::_duplicate(server)),
8 another_ (Another_One::_duplicate (another)),
9 niterations_ (niterations)
13 void
14 Client_Worker::validate_connection (void)
16 // Ping the object 100 times, ignoring all exceptions.
17 // It would be better to use validate_connection() but the test must
18 // run on minimum CORBA builds too!
20 for (int j = 0; j != 100; ++j)
22 try
24 this->server_->test_method (j);
25 this->another_->test_method (j);
26 if(TAO_debug_level > 0)
27 ACE_DEBUG (( LM_DEBUG,
28 "******** VALIDATED *******\n"));
30 catch (const CORBA::Exception&)
36 int
37 Client_Worker::svc (void)
40 try
42 // Validate connections befire doing any actual work..
43 this->validate_connection ();
45 for (int i = 0; i < this->niterations_; ++i)
47 this->server_->test_method (i);
48 this->another_->test_method (i);
50 if (TAO_debug_level > 0)
51 ACE_DEBUG ((LM_DEBUG,
52 " (%P|%t) iteration = %d\n",
53 i));
56 catch (const CORBA::Exception& ex)
58 ex._tao_print_exception ("Client_Worker : Exception Raised");
60 return 0;