diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-07 23:58:34 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-07 23:58:34 +0000 |
commit | 81e0a245decc09943832d52cb9f419e3f8f355b7 (patch) | |
tree | 8aaf3418082d4c3b107e2f01eedf0d55095c7ec7 /TAO/tao/Thread_Lane_Resources.cpp | |
parent | 784fe453b13e068e3ec273b9a0f4021ac5a51e96 (diff) | |
download | ATCD-81e0a245decc09943832d52cb9f419e3f8f355b7.tar.gz |
ChangeLogTag: Mon Jul 07 18:00:38 2003 Irfan Pyarali <irfan@oomworks.com>
Diffstat (limited to 'TAO/tao/Thread_Lane_Resources.cpp')
-rw-r--r-- | TAO/tao/Thread_Lane_Resources.cpp | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/TAO/tao/Thread_Lane_Resources.cpp b/TAO/tao/Thread_Lane_Resources.cpp index ff2b263fd1d..d0c9327755c 100644 --- a/TAO/tao/Thread_Lane_Resources.cpp +++ b/TAO/tao/Thread_Lane_Resources.cpp @@ -8,7 +8,9 @@ ACE_RCSID(tao, Thread_Lane_Resources, "$Id$") #include "tao/Acceptor_Registry.h" #include "tao/Transport_Cache_Manager.h" #include "tao/Leader_Follower.h" -#include "Connector_Registry.h" +#include "tao/Connection_Handler.h" +#include "tao/Transport.h" +#include "tao/Connector_Registry.h" #include "ace/Reactor.h" @@ -260,37 +262,28 @@ TAO_Thread_Lane_Resources::finalize (void) delete this->acceptor_registry_; } - // Set of file descriptors corresponding to open connections. This - // handle set is used to explicitly deregister the connection event - // handlers from the Reactor. This is particularly important for - // dynamically loaded ORBs where an application level reactor, such - // as the Singleton reactor, is used instead of an ORB created one. - ACE_Handle_Set handle_set; - TAO_EventHandlerSet unregistered; - - // Close the transport cache and return the handle set that needs - // to be de-registered from the reactor. - this->transport_cache_->close (handle_set, unregistered); - - // Shutdown all open connections that are registered with the ORB - // Core. Note that the ACE_Event_Handler::DONT_CALL mask is NOT - // used here since the reactor should invoke each handle's - // corresponding ACE_Event_Handler::handle_close() method to ensure - // that the connection is shutdown gracefully prior to destroying - // the ORB Core. - if (handle_set.num_set () > 0) - (void) this->leader_follower ().reactor ()->remove_handler (handle_set, - ACE_Event_Handler::ALL_EVENTS_MASK); - if (!unregistered.is_empty ()) + // Set of handlers still in the connection cache. + TAO_Connection_Handler_Set handlers; + + // Close the transport cache and return the handlers that were still + // registered. The cache will decrease the #REFCOUNT# on the + // handler when it removes the handler from cache. However, + // #REFCOUNT# is increased when the handler is placed in the handler + // set. + this->transport_cache_->close (handlers); + + // Go through the handler set, closing the connections and removing + // the references. + TAO_Connection_Handler **handler = 0; + for (TAO_Connection_Handler_Set::iterator iter (handlers); + iter.next (handler); + iter.advance ()) { - ACE_Event_Handler** eh; - for (TAO_EventHandlerSetIterator iter(unregistered); - iter.next (eh); - iter.advance()) - { - (*eh)->handle_close (ACE_INVALID_HANDLE, - ACE_Event_Handler::ALL_EVENTS_MASK); - } + // Connection is closed. Potential removal from the Reactor. + (*handler)->close_connection (); + + // #REFCOUNT# related to the handler set decreases. + (*handler)->transport ()->remove_reference (); } delete this->transport_cache_; |