Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / Two_Objects / Second_i.cpp
blobc4f0211bc579eca38133ec6d138956175c0efd80
1 #include "Second_i.h"
2 #include "tao/ORB_Core.h"
3 #include "tao/debug.h"
4 #include "tao/Transport_Cache_Manager.h"
5 #include "tao/Thread_Lane_Resources.h"
6 #include "ace/Auto_Event.h"
8 Second_i::Second_i (CORBA::ORB_ptr orb,
9 CORBA::ULong len, ACE_Auto_Event &two_way_done)
10 : orb_ (CORBA::ORB::_duplicate (orb)),
11 length_(len),
12 two_way_done_(two_way_done)
16 Two_Objects_Test::Octet_Seq *
17 Second_i::twoway_method ()
19 Two_Objects_Test::Octet_Seq *preply_mesg = 0;
21 ACE_NEW_THROW_EX (preply_mesg,
22 Two_Objects_Test::Octet_Seq (this->length_),
23 CORBA::NO_MEMORY ());
25 Two_Objects_Test::Octet_Seq_var reply_var =
26 preply_mesg;
27 reply_var->length (this->length_);
29 ACE_DEBUG ((LM_DEBUG,
30 "Twoway servant : (%P|%t) two way method called.\n"));
32 // @@ This will not work with the latest copy of ACE+TAO :-). Irfan
33 // has moved the cache somewhere else. You may want to check the
34 // latest code in BiDir cals again ;)
35 // @@ Try to use the current_size () instead of total_size ()
36 ACE_ASSERT(this->orb_->orb_core ()->lane_resources().
37 transport_cache ().current_size () == 1);
39 ACE_DEBUG ((LM_DEBUG,
40 "Twoway servant : (%P|%t) about to signal one way thread.\n"));
42 two_way_done_.signal ();
44 return reply_var._retn ();
47 void
48 Second_i::shutdown ()
50 ACE_DEBUG ((LM_DEBUG, "(%P|%t) about to shutdown the orb\n"));
51 this->orb_->shutdown (false);