From 3c68205637b71f97b82f139d819b12cf55bda1e3 Mon Sep 17 00:00:00 2001 From: bala Date: Sat, 4 Nov 2000 03:13:26 +0000 Subject: *** empty log message *** --- TAO/tao/Connection_Cache_Manager.cpp | 49 +++++++++++++++++++++++++++--------- TAO/tao/Connection_Handler.cpp | 11 ++++---- TAO/tao/Connection_Handler.h | 4 +++ TAO/tao/IIOP_Connector.cpp | 5 ++++ 4 files changed, 52 insertions(+), 17 deletions(-) diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp index ffd45ce44d2..262110dc7f2 100644 --- a/TAO/tao/Connection_Cache_Manager.cpp +++ b/TAO/tao/Connection_Cache_Manager.cpp @@ -38,15 +38,17 @@ TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, entry); if (retval == 0) { + int_id.handler ()->test_index_ = ext_id.index (); + // The entry has been added to cache succesfully // Add the cache_map_entry to the handler int_id.handler () ->cache_map_entry (entry); } else if (retval == 1) { - if (TAO_debug_level > 0 && retval != 0) + if (TAO_debug_level > 5 && retval != 0) { - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::bind_i") ACE_TEXT (" unable to bind in the first attempt \n") ACE_TEXT (" So trying with a new index \n"))); @@ -65,7 +67,7 @@ TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, } } - if (TAO_debug_level > 0 && retval != 0) + if (TAO_debug_level > 6 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::bind_i") @@ -88,24 +90,34 @@ TAO_Connection_Cache_Manager::find_i (const TAO_Cache_ExtId &key, // Get the index of the int index = key.index (); + // Make a temporary object. It does not do a copy. + TAO_Cache_ExtId tmp_key (key.property ()); + while (retval == 0) { - // Make a temporary object. It does not do a copy. - TAO_Cache_ExtId tmp_key (key.property ()); - // Look for an entry in the map - retval = this->cache_map_.find (key, + retval = this->cache_map_.find (tmp_key, entry); // We have an entry in the map, check whether it is idle. If it // is idle it would be marked as busy. if (entry) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("Point 1 <%d> \n"), + entry->int_id_.handler ()->test_index_)); + CORBA::Boolean idle = this->is_entry_idle (entry); if (idle) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("Point 2 <%d> \n"), + entry->int_id_.handler ()->test_index_)); + // We have a succesful entry value = entry->int_id_; return 0; @@ -117,7 +129,7 @@ TAO_Connection_Cache_Manager::find_i (const TAO_Cache_ExtId &key, } // If we are here then it is an error - if (TAO_debug_level > 0 && retval != 0) + if (TAO_debug_level > 5 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::find_i") @@ -167,12 +179,17 @@ TAO_Connection_Cache_Manager::make_idle_i (HASH_MAP_ENTRY *&entry) new_entry); if (retval == 0) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("We are getting idle <%d> \n"), + entry->int_id_.handler ()->test_index_)); + new_entry->int_id_. recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE); entry = new_entry; } - else if (TAO_debug_level > 0 && retval != 0) + else if (TAO_debug_level > 5 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::make_idle_i") @@ -193,12 +210,13 @@ TAO_Connection_Cache_Manager::mark_closed_i (HASH_MAP_ENTRY *&entry) new_entry); if (retval == 0) { + new_entry->int_id_. recycle_state (ACE_RECYCLABLE_CLOSED); entry = new_entry; } - else if (TAO_debug_level > 0 && retval != 0) + else if (TAO_debug_level > 5 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::make_idle_i") @@ -266,6 +284,8 @@ TAO_Connection_Cache_Manager:: this->cache_map_.find (key); } + val.handler ()->test_index_ = ctr; + // Now do a bind again with the new index return this->cache_map_.bind (key, val, @@ -280,16 +300,21 @@ TAO_Connection_Cache_Manager:: if (entry->int_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || entry->int_id_.recycle_state () == ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("I got this Handler <%d> \n"), + entry->int_id_.handler ()->test_index_)); + // Save that in the handler entry->int_id_.handler ()->cache_map_entry (entry); // Mark the connection as busy entry->int_id_.recycle_state (ACE_RECYCLABLE_BUSY); - return 0; + return 1; } - return -1; + return 0; } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index 3b00a682d74..13fef2d6dda 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -13,11 +13,12 @@ ACE_RCSID(tao, Connection_Handler, "$Id$") TAO_Connection_Handler::TAO_Connection_Handler (TAO_ORB_Core *orb_core) - :orb_core_ (orb_core), - tss_resources_ (orb_core->get_tss_resources ()), - ref_count_ (1), - cache_map_entry_ (0), - is_registered_ (0) + : test_index_ (0), + orb_core_ (orb_core), + tss_resources_ (orb_core->get_tss_resources ()), + ref_count_ (1), + cache_map_entry_ (0), + is_registered_ (0) { } diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index 3ee33268792..13b8e46fdf9 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -95,6 +95,8 @@ public: virtual ACE_HANDLE fetch_handle (void) = 0; // Get the underlying handle + CORBA::Long test_index_; + // test index protected: void remove_handle (ACE_HANDLE handle); @@ -148,6 +150,8 @@ private: CORBA::Boolean is_registered_; // Are we registered with the reactor? + + }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 475110602a7..ab24db059cd 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -194,6 +194,10 @@ TAO_IIOP_Connector::connect (TAO_Base_Connection_Property *prop, ACE_dynamic_cast (TAO_IIOP_Client_Connection_Handler *, conn_handler); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) IIOP_Connector::connect ") + ACE_TEXT ("I got this Handler <%d> \n"), + svc_handler->test_index_)); } else { @@ -261,6 +265,7 @@ TAO_IIOP_Connector::connect (TAO_Base_Connection_Property *prop, } } + transport = svc_handler->transport (); return 0; } -- cgit v1.2.1