summaryrefslogtreecommitdiff
path: root/TAO/tao/Wait_On_Read.cpp
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-08-27 05:01:07 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-08-27 05:01:07 +0000
commitdd451909a6c9b611c076e160567878c25d6febcb (patch)
tree92b365d819090f558b5e7cb749f981caa7c97099 /TAO/tao/Wait_On_Read.cpp
parentfc2d77f90a99cf39e6d46ae60cc54286ebb6dbea (diff)
downloadATCD-dd451909a6c9b611c076e160567878c25d6febcb.tar.gz
ChangeLogTag:Fri Aug 26 23:48:25 2005 Balachandran Natarajan <bala@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Wait_On_Read.cpp')
-rw-r--r--TAO/tao/Wait_On_Read.cpp46
1 files changed, 40 insertions, 6 deletions
diff --git a/TAO/tao/Wait_On_Read.cpp b/TAO/tao/Wait_On_Read.cpp
index 01dc3c8a4d0..3a0d4b9a316 100644
--- a/TAO/tao/Wait_On_Read.cpp
+++ b/TAO/tao/Wait_On_Read.cpp
@@ -1,10 +1,12 @@
// $Id$
-#include "tao/Wait_On_Read.h"
-#include "tao/Transport.h"
-#include "tao/Resume_Handle.h"
-#include "tao/Synch_Reply_Dispatcher.h"
-
+#include "Wait_On_Read.h"
+#include "Transport.h"
+#include "Resume_Handle.h"
+#include "Synch_Reply_Dispatcher.h"
+#include "Client_Strategy_Factory.h"
+#include "ORB_Core.h"
+#include "ace/Reactor.h"
#include "ace/Countdown_Time.h"
ACE_RCSID (tao,
@@ -62,7 +64,39 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time,
}
if (rd.successful ())
- return 0;
+ {
+ TAO_ORB_Core *oc =
+ this->transport_->orb_core ();
+
+ if (!oc->client_factory ()->use_cleanup_options ())
+ return 0;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - TAO_Wait_On_Read[%d]::wait (), ")
+ ACE_TEXT ("registering handle for cleanup \n"),
+ this->transport_->id ()));
+
+ ACE_Event_Handler *eh =
+ this->transport_->event_handler_i ();
+
+ ACE_Reactor *r =
+ this->transport_->orb_core ()->reactor ();
+
+ if (r->register_handler (eh,
+ ACE_Event_Handler::READ_MASK) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - TAO_Wait_On_Read[%d]::wait (), ")
+ ACE_TEXT ("registration with reactor returned an error \n"),
+ this->transport_->id ()));
+ }
+
+ this->is_registered_ = 1;
+
+ return 0;
+ }
if (rd.error_detected ())
return -1;