diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-04-23 17:21:58 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-04-23 17:21:58 +0000 |
commit | 44ae442f84fc9b8fca656e6fc96216c6ca0c5c1e (patch) | |
tree | 299af04c6565800af7c2fae2b78bfae492c8d101 | |
parent | 0f42760f1ca55517413e41aa8b832aff6d110e7f (diff) | |
download | ATCD-44ae442f84fc9b8fca656e6fc96216c6ca0c5c1e.tar.gz |
ChangeLogTag: Tue Apr 23 12:16:01 2002 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/tao/ChangeLog | 24 | ||||
-rw-r--r-- | TAO/tao/Connection_Handler.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Connection_Handler.h | 2 | ||||
-rw-r--r-- | TAO/tao/Connection_Handler.inl | 2 | ||||
-rw-r--r-- | TAO/tao/Connector_Impl.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connection_Handler.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connection_Handler.h | 6 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.cpp | 7 |
8 files changed, 46 insertions, 20 deletions
diff --git a/TAO/tao/ChangeLog b/TAO/tao/ChangeLog index 7c72cce026e..8443e86cf66 100644 --- a/TAO/tao/ChangeLog +++ b/TAO/tao/ChangeLog @@ -1,3 +1,27 @@ +Tue Apr 23 12:16:01 2002 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/Connection_Handler.cpp: + * tao/Connection_Handler.h: + * tao/Connection_Handler.inl: Removed the virtual method + shutdown_object (). Made the handle_close_i () implemented in + all protocols a pure virtual method in this class. + + The decr_refcount () calls handle_close_i () when the refcount + reaches zero instead of shutdown_object (). + + * tao/IIOP_Connection_Handler.cpp: When the upcall count reaches + zero, we call decr_refcount () in handle_close () and + handle_input (). + + * tao/Connector_Impl.cpp: Incremented the refcount of the + connection handler as soon as it is created, since we are aware + that this handler could land up in the reactor if the right + strategies are used. + + * tao/IIOP_Connector.cpp: Decermented the refcount of the handler + after the wait () call. Unsuccesful connects will destroy the + handler at this point. + Mon Apr 22 17:53:04 2002 Balachandran Natarajan <bala@cs.wustl.edu> * tao/Connection_Handler.cpp: diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index 6e04b73995c..37c199ca902 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -26,6 +26,7 @@ TAO_Connection_Handler::TAO_Connection_Handler (TAO_ORB_Core *orb_core) pending_upcall_lock_ (0) { + // NOTE: Why should the refcount be // @@todo: We need to have a distinct option/ method in the resource // factory for this and TAO_Transport. this->pending_upcall_lock_ = diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index d355723642c..15b6ab05910 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -96,7 +96,7 @@ protected: int pending_upcalls (void) const; /// Shutdown the object - virtual void shutdown_object (void) = 0; + virtual void handle_close_i (void) = 0; private: /// Pointer to the TAO_ORB_Core diff --git a/TAO/tao/Connection_Handler.inl b/TAO/tao/Connection_Handler.inl index 32925823956..6e982ced480 100644 --- a/TAO/tao/Connection_Handler.inl +++ b/TAO/tao/Connection_Handler.inl @@ -65,7 +65,7 @@ TAO_Connection_Handler::decr_refcount (void) } if (this->reference_count_ == 0) - this->shutdown_object (); + this->handle_close_i (); } ACE_INLINE int diff --git a/TAO/tao/Connector_Impl.cpp b/TAO/tao/Connector_Impl.cpp index 6c4023da250..757a511d2ae 100644 --- a/TAO/tao/Connector_Impl.cpp +++ b/TAO/tao/Connector_Impl.cpp @@ -38,6 +38,12 @@ TAO_Connect_Creation_Strategy<SVC_HANDLER>::make_svc_handler (SVC_HANDLER *&sh) this->lite_flag_, this->arg_), -1); + + // Add a reference count. Why is this needed? We need this to make + // sure that the connector doesnt delete this handler when we are + // waiting for non-blocking connects to complete. + sh->incr_refcount (); + return 0; } diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index 87946dbd08c..db385c79c73 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -194,7 +194,6 @@ int TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask rm) { - ACE_OS::abort (); // @@ Alex: we need to figure out if the transport decides to close // us or something else. If it is something else (for example // the cached connector trying to make room for other @@ -229,7 +228,7 @@ TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE handle, // If the upcall count is zero start the cleanup. if (upcalls == 0) - this->handle_close_i (); + this->decr_refcount (); return 0; } @@ -265,13 +264,6 @@ TAO_IIOP_Connection_Handler::handle_close_i (void) // TAO_Transport::release (). this->transport (0); - // Decrement the refcount for automatic memory management - this->decr_refcount (); -} - -void -TAO_IIOP_Connection_Handler::shutdown_object (void) -{ // Follow usual Reactor-style lifecycle semantics and commit // suicide. this->destroy (); @@ -376,11 +368,11 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE) if (upcalls == 0) { - this->handle_close_i (); + this->decr_refcount (); - // As we have already performed the handle closing we dont want - // to return a -1. Doing so would make the reactor call - // handle_close () which could be harmful. + // As we have already performed the handle closing (indirectly) + // we dont want to return a -1. Doing so would make the reactor + // call handle_close () which could be harmful. retval = 0; } else if (upcalls < 0) diff --git a/TAO/tao/IIOP_Connection_Handler.h b/TAO/tao/IIOP_Connection_Handler.h index dab072c4781..fbf5d02d2bf 100644 --- a/TAO/tao/IIOP_Connection_Handler.h +++ b/TAO/tao/IIOP_Connection_Handler.h @@ -133,11 +133,7 @@ protected: /// ensure that server threads eventually exit. virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE); - // = Connection handler overload - virtual void shutdown_object (void); - -private: - + /// Connection Handler overloads /// Perform appropriate closing. void handle_close_i (void); diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index eeaf480ace1..207b101ac73 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -186,6 +186,13 @@ TAO_IIOP_Connector::make_connection (TAO_GIOP_Invocation *invocation, } + cout << "Asked to go " << endl; + // Reduce the refcount to the svc_handler that we have. The + // increment to the handler is done in make_svc_handler (). Now + // that we dont need the reference to it anymore we can decrement + // the refcount whether the connection is successful ot not. + svc_handler->decr_refcount (); + if (result == -1) { // Give users a clue to the problem. |