1 #include "bidir_giop_pch.h"
5 #include "tao/ORB_Core.h"
6 #include "tao/Transport_Cache_Manager.h"
7 #include "tao/Thread_Lane_Resources.h"
11 Simple_i::Simple_i (CORBA::ORB_ptr orb
, int callback_count
)
12 : orb_(CORBA::ORB::_duplicate(orb
))
13 , ready_for_callback_(0)
14 , callback_count_(callback_count
)
19 CORBA::Long
Simple_i::test_method (CORBA::Boolean do_callback
)
22 ready_for_callback_
= 1;
27 void Simple_i::callback_object (Callback_ptr cb
)
29 callback_
= Callback::_duplicate(cb
);
32 void Simple_i::shutdown ()
34 CORBA::Boolean wait
= false;
39 Simple_i::call_client()
41 if (ready_for_callback_
) {
42 ready_for_callback_
= 0;
44 for (int times
= 0; times
< callback_count_
; ++times
) {
45 callback_
->callback_method();
47 if (orb_
->orb_core()->lane_resources().transport_cache().current_size() > 1)
49 std::cerr
<< "The connection cache has grown. "
50 << "BiDirection did not work. aborting..." << std::endl
;
51 ACE_OS::abort(); // Should probably define and throw a UserException
55 callback_
->shutdown();