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 Simple_i::~Simple_i (void)
23 CORBA::Long
Simple_i::test_method (CORBA::Boolean do_callback
)
26 ready_for_callback_
= 1;
31 void Simple_i::callback_object (Callback_ptr cb
)
33 callback_
= Callback::_duplicate(cb
);
36 void Simple_i::shutdown ()
38 CORBA::Boolean wait
= false;
43 Simple_i::call_client()
45 if (ready_for_callback_
) {
47 ready_for_callback_
= 0;
49 for (int times
= 0; times
< callback_count_
; ++times
) {
51 callback_
->callback_method();
53 if (orb_
->orb_core()->lane_resources().transport_cache().current_size() > 1)
55 std::cerr
<< "The connection cache has grown. "
56 << "BiDirection did not work. aborting..." << std::endl
;
57 ACE_OS::abort(); // Should probably define and throw a UserException
61 callback_
->shutdown();