summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp48
1 files changed, 22 insertions, 26 deletions
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
index 6d726f09f88..6e2bfe10c7c 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
@@ -217,39 +217,35 @@ TAO_UIPMC_Connection_Handler::svc (void)
int
TAO_UIPMC_Connection_Handler::handle_close (ACE_HANDLE handle,
- ACE_Reactor_Mask rm)
+ ACE_Reactor_Mask rm)
{
- // @@ 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
- // connections) then we should let the transport know, so it can
- // in turn take appropiate action (such as sending exceptions to
- // all waiting reply handlers).
+ // @@ TODO this too similar to IIOP_Connection_Handler::handle_close,
+ // in fact, even the comments were identical. IMHO needs
+ // re-factoring.
+ ACE_HANDLE my_handle = this->get_handle ();
+
if (TAO_debug_level)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) ")
- ACE_TEXT ("UIPMC_Connection_Handler::handle_close ")
- ACE_TEXT ("(%d, %d)\n"),
- handle,
- rm));
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - UIPMC_Connection_Handler[%d]::handle_close, "
+ "(%d, %d)\n",
+ my_handle, handle, rm));
+ }
- long upcalls =
- this->decr_pending_upcalls ();
+ if(my_handle == ACE_INVALID_HANDLE)
+ {
+ return 0;
+ }
+ this->peer().close ();
- if (upcalls < 0)
- return 0;
+ this->set_handle (ACE_INVALID_HANDLE);
+ this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED);
- if (this->get_handle () != ACE_INVALID_HANDLE)
- {
- // Just close the socket irrespective of what the upcall count
- // is.
- this->peer().close ();
+ long upcalls = this->decr_pending_upcalls ();
- // Set the handle to be INVALID_HANDLE
- this->set_handle (ACE_INVALID_HANDLE);
- }
+ if (upcalls < 0)
+ return 0;
- // Try to clean up things if the upcall count has reached 0
if (upcalls == 0)
this->decr_refcount ();