From 99906602157fe5ad02790a079758ab1324f228a6 Mon Sep 17 00:00:00 2001 From: bala Date: Tue, 12 Nov 2002 17:09:43 +0000 Subject: ChangeLogTag: Tue Nov 12 11:08:32 2002 Balachandran Natarajan --- TAO/ChangeLog | 9 +++++++++ TAO/tao/Connection_Handler.cpp | 25 ++++++++++++------------- TAO/tao/Connection_Handler.h | 23 ++++++++++++----------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 5c1e0d11689..c9022ed8bb7 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Tue Nov 12 11:08:32 2002 Balachandran Natarajan + + * tao/Connection_Handler.h: Commented out the following calls + incr_pending_upcalls (), decr_pending_upcalls () and + pending_upcalls (), since there was no implementation and they + were not at all used. + + * tao/Connection_Handler.cpp: Cosmetic changes. + Tue Nov 12 10:17:05 2002 Jeff Parsons * orbsvcs/orbsvcs/Log/NotifyLogNotification.h: diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index 39ad7108410..04e383a206e 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -349,6 +349,8 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); handle = eh->get_handle (); + + // Double-checked locking. if(handle == ACE_INVALID_HANDLE) { return 0; @@ -386,7 +388,7 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Connection_Handler[%d]::" "close_connection, purging entry from cache\n", - id)); + handle)); } this->transport ()->purge_entry (); @@ -411,7 +413,7 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Connection_Handler[%d]::" "close_connection, removing from the reactor\n", - id)); + handle)); } int r = reactor->remove_handler (handle, @@ -422,7 +424,7 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - Connection_Handler[%d]::" "close_connection, error in remove_handler (%d)\n", - id, r)); + handle, r)); } // Also cancel any timers, we may create those for time-limited @@ -431,8 +433,8 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) { ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t) - Connection_Handler[%d]::" - "close_connection, cancel all timers\n", - id)); + "close_connection, cancel all timers and refcount [%d]\n", + handle, reference_count_)); } r = reactor->cancel_timer (eh); if (r == -1 && TAO_debug_level) @@ -440,30 +442,27 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - Connection_Handler[%d]::" "close_connection, error cancelling timers\n", - id)); + handle)); } // @@ This seems silly, the reactor is a much better authority to // find out if a handle is registered... this->transport ()->wait_strategy ()->is_registered (0); - // Close the socket, implicitly this makes: - // get_handle() == ACE_INVALID_HANDLE - // At this point any further calls to handle_close() or - // close_connection() become no-ops r = this->release_os_resources (); + if (r == -1 && TAO_debug_level) { ACE_ERROR ((LM_ERROR, "TAO (%P|%t) - Connection_Handler[%d]::" "close_connection, release_os_resources() failed %p\n", - id, "")); + handle, "")); } - ACE_ASSERT(eh->get_handle() == ACE_INVALID_HANDLE); + ACE_ASSERT (eh->get_handle() == ACE_INVALID_HANDLE); } - ACE_ASSERT(this->transport () != 0); + ACE_ASSERT (this->transport () != 0); this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED); diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index c72d1c92c6f..a54eeee6ae9 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -16,7 +16,7 @@ #include "ace/pre.h" -#include "LF_Event.h" +#include "LF_CH_Event.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -41,7 +41,7 @@ class ACE_Event_Handler; * right protocol. This way, most of the common code for the * different protocols would be in this implementation. */ -class TAO_Export TAO_Connection_Handler : public TAO_LF_Event +class TAO_Export TAO_Connection_Handler : public TAO_LF_CH_Event { public: @@ -104,15 +104,16 @@ protected: /// Object. int svc_i (void); - /// Increment and decrement the number of upcalls that have gone - /// through this handler. Returns the upcall count. The calls are - /// thread safe.. - int incr_pending_upcalls (void); - - int decr_pending_upcalls (void); - - /// Query the upcall count - int pending_upcalls (void) const; + /**** + * Not sure where they are defined and used.. Looks legacy. + * + * Increment and decrement the number of upcalls that have gone + * this handler. Returns the upcall count. The calls are + * safe.. + * int incr_pending_upcalls (void); + * int decr_pending_upcalls (void); + * int pending_upcalls (void) const; + */ //@{ /** -- cgit v1.2.1