summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_Connection_Handler.cpp
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2001-09-27 23:00:38 +0000
committerbala <balanatarajan@users.noreply.github.com>2001-09-27 23:00:38 +0000
commit53e2e70a391fef685c7f8fce88e081d0ba9b5185 (patch)
treefb00fc546c58b605832a472869160052031e5169 /TAO/tao/IIOP_Connection_Handler.cpp
parent5a8fcb117d05ba23fbf9d5a30d2d74595ad5ce72 (diff)
downloadATCD-53e2e70a391fef685c7f8fce88e081d0ba9b5185.tar.gz
ChangeLogTag: Thu Sep 27 17:31:10 2001 Balachandran Natarajan <bala@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/IIOP_Connection_Handler.cpp')
-rw-r--r--TAO/tao/IIOP_Connection_Handler.cpp90
1 files changed, 61 insertions, 29 deletions
diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp
index 1f7cc7c3c7d..becdbab5f81 100644
--- a/TAO/tao/IIOP_Connection_Handler.cpp
+++ b/TAO/tao/IIOP_Connection_Handler.cpp
@@ -205,40 +205,56 @@ TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE handle,
long upcalls = this->decr_pending_upcalls ();
- if (upcalls <= 0)
- {
- if (this->transport ()->wait_strategy ()->is_registered ())
- {
- // Make sure there are no timers.
- this->reactor ()->cancel_timer (this);
+ ACE_ASSERT (upcalls >= 0);
- // Set the flag to indicate that it is no longer registered with
- // the reactor, so that it isn't included in the set that is
- // passed to the reactor on ORB destruction.
- this->transport ()->wait_strategy ()->is_registered (0);
- }
+ // If the upcall count is zero start the cleanup.
+ if (upcalls == 0)
+ this->handle_close_i ();
- // Close the handle..
- if (this->get_handle () != ACE_INVALID_HANDLE)
- {
- // Remove the entry as it is invalid
- this->transport ()->purge_entry ();
+ return 0;
+}
- // Signal the transport that we will no longer have
- // a reference to it. This will eventually call
- // TAO_Transport::release ().
- this->transport (0);
- }
- // Follow usual Reactor-style lifecycle semantics and commit
- // suicide.
- this->destroy ();
+void
+TAO_IIOP_Connection_Handler::handle_close_i (void)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) ")
+ ACE_TEXT ("IIOP_Connection_Handler::handle_close_i ")
+ ACE_TEXT ("(%d)\n"),
+ this->transport ()->id ()));
+
+ if (this->transport ()->wait_strategy ()->is_registered ())
+ {
+ // Make sure there are no timers.
+ this->reactor ()->cancel_timer (this);
+
+ // Set the flag to indicate that it is no longer registered with
+ // the reactor, so that it isn't included in the set that is
+ // passed to the reactor on ORB destruction.
+ this->transport ()->wait_strategy ()->is_registered (0);
}
- return 0;
+ // Close the handle..
+ if (this->get_handle () != ACE_INVALID_HANDLE)
+ {
+ // Remove the entry as it is invalid
+ this->transport ()->purge_entry ();
+
+ // Signal the transport that we will no longer have
+ // a reference to it. This will eventually call
+ // TAO_Transport::release ().
+ this->transport (0);
+ }
+
+ // Follow usual Reactor-style lifecycle semantics and commit
+ // suicide.
+ this->destroy ();
}
+
int
TAO_IIOP_Connection_Handler::resume_handler (void)
{
@@ -322,20 +338,36 @@ TAO_IIOP_Connection_Handler::process_listen_point_list (
int
-TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE)
+TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE h)
{
// Increase the reference count on the upcall that have passed us.
- this->incr_pending_upcalls ();
+ long upcalls = this->incr_pending_upcalls ();
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Refcount on handle [%d] incremented to [%d]\n",
+ h, upcalls));
TAO_Resume_Handle resume_handle (this->orb_core (),
this->get_handle ());
int retval = this->transport ()->handle_input_i (resume_handle);
// The upcall is done. Bump down the reference count
- if (this->decr_pending_upcalls () <= 0)
- retval = -1;
+ upcalls = this->decr_pending_upcalls ();
+
+ ACE_ASSERT (upcalls >= 0);
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Refcount on handle [%d] decremented to [%d]\n",
+ h, upcalls));
+
+ if (upcalls == 0)
+ {
+ this->handle_close_i ();
+ retval = -1;
+ }
if (retval == -1)
{