Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / BiDirectional / test_i.cpp
blob61c908bca61c8d61962ccd1e1b5f64a8dfb30f24
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__ */
12 void
13 Callback_i::shutdown ()
15 ACE_DEBUG ((LM_DEBUG, "Performing clean shutdown\n"));
16 this->orb_->shutdown (false);
19 void
20 Callback_i::callback_method (/**/)
22 if (TAO_debug_level > 0)
23 ACE_DEBUG ((LM_DEBUG, "Callback method called\n"));
27 // ****************************************************************
29 CORBA::Long
30 Simple_Server_i::test_method (CORBA::Boolean do_callback
33 if (do_callback)
35 this->flag_ = 1;
38 return 0;
41 void
42 Simple_Server_i::callback_object (Callback_ptr callback
45 // Store the callback object
46 this->callback_ = Callback::_duplicate (callback);
49 int
50 Simple_Server_i::call_client ()
52 if (this->flag_)
54 for (int times = 0; times < this->no_iterations_; ++times)
56 this->callback_->callback_method ();
58 // If the cache size has gotten larger this indicates that
59 // the connection isn't being shared properly, i.e., a new
60 // connection was created, so we'll abort.
61 if (this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size () > 1)
63 ACE_ERROR ((LM_ERROR,
64 "(%P|%t) The cache has grown, aborting ..\n"));
66 ACE_OS::abort ();
70 this->callback_->shutdown ();
71 this->flag_ = 0;
73 return 1;
76 return 0;
80 void
81 Simple_Server_i::shutdown ()
83 this->orb_->shutdown (false);