Merge pull request #2316 from jwillemsen/jwi-taskcommenttypo
[ACE_TAO.git] / TAO / orbsvcs / tests / Security / BiDirectional / test_i.cpp
blobd1e7215d8ee60d4e0587b3e26ba938d7a98a3a2b
1 #include "test_i.h"
3 #include "tao/ORB_Core.h"
4 #include "tao/debug.h"
5 #include "tao/Transport_Cache_Manager.h"
6 #include "tao/Thread_Lane_Resources.h"
8 #if !defined(__ACE_INLINE__)
9 #include "test_i.inl"
10 #endif /* __ACE_INLINE__ */
13 void
14 Callback_i::shutdown ()
16 ACE_DEBUG ((LM_DEBUG, "Performing clean shutdown\n"));
17 this->orb_->shutdown (false);
20 void
21 Callback_i::callback_method ()
23 if (TAO_debug_level > 0)
24 ACE_DEBUG ((LM_DEBUG, "Callback method called\n"));
28 // ****************************************************************
30 CORBA::Long
31 Simple_Server_i::test_method (CORBA::Boolean do_callback
34 if (do_callback)
36 this->flag_ = 1;
39 return 0;
42 void
43 Simple_Server_i::callback_object (Callback_ptr callback
46 // Store the callback object
47 this->callback_ = Callback::_duplicate (callback);
50 int
51 Simple_Server_i::call_client ()
53 size_t pre_call_connections =
54 this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size ();
56 if (this->flag_)
58 for (int times = 0; times < this->no_iterations_; ++times)
60 this->callback_->callback_method ();
62 size_t cur_connections =
63 this->orb_->orb_core()->lane_resources().transport_cache().current_size ();
65 if (cur_connections > pre_call_connections)
67 ACE_ERROR ((LM_ERROR,
68 "(%P|%t) TEST OUTPUT: expected to find %d "
69 "connections in the transport cache, but found "
70 "%d instead. Aborting.\n",
71 pre_call_connections,
72 cur_connections));
74 ACE_OS::abort ();
78 this->callback_->shutdown ();
79 this->flag_ = 0;
81 return 1;
84 return 0;
88 void
89 Simple_Server_i::shutdown ()
91 this->orb_->shutdown (false);