summaryrefslogtreecommitdiff
path: root/TAO/tao/Leader_Follower_Flushing_Strategy.cpp
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-01 23:39:57 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-01 23:39:57 +0000
commit28f2b1eecfab765469d97d38b686bffdea53114c (patch)
treee11d110b2f6e69f07a780756276cc735be3e8fa9 /TAO/tao/Leader_Follower_Flushing_Strategy.cpp
parent545c5cb11c374d0333e7d0f1c88f12694ad2eaee (diff)
downloadATCD-28f2b1eecfab765469d97d38b686bffdea53114c.tar.gz
ChangeLogTag:Wed Aug 1 16:05:36 2001 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao/Leader_Follower_Flushing_Strategy.cpp')
-rw-r--r--TAO/tao/Leader_Follower_Flushing_Strategy.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/TAO/tao/Leader_Follower_Flushing_Strategy.cpp b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp
new file mode 100644
index 00000000000..152ae60c0d7
--- /dev/null
+++ b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+// $Id$
+
+#include "tao/Leader_Follower_Flushing_Strategy.h"
+#include "tao/Leader_Follower.h"
+#include "tao/Transport.h"
+#include "tao/ORB_Core.h"
+#include "tao/Queued_Message.h"
+#include "tao/debug.h"
+
+ACE_RCSID(tao, Leader_Follower_Flushing_Strategy, "$Id$")
+
+int
+TAO_Leader_Follower_Flushing_Strategy::schedule_output (TAO_Transport *transport)
+{
+ return transport->schedule_output_i ();
+}
+
+int
+TAO_Leader_Follower_Flushing_Strategy::cancel_output (TAO_Transport *transport)
+{
+ return transport->cancel_output_i ();
+}
+
+int
+TAO_Leader_Follower_Flushing_Strategy::flush_message (TAO_Transport *transport,
+ TAO_Queued_Message *msg,
+ ACE_Time_Value *max_wait_time)
+{
+ TAO_Leader_Follower &leader_follower =
+ transport->orb_core ()->leader_follower ();
+ return leader_follower.wait_for_event (msg, transport, max_wait_time);
+}
+
+int
+TAO_Leader_Follower_Flushing_Strategy::flush_transport (TAO_Transport *transport)
+{
+ // @todo This is not the right way to do this....
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_ORB_Core *orb_core = transport->orb_core ();
+
+ while (!transport->queue_is_empty ())
+ {
+ int result = orb_core->run (0, 1, ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ if (result == -1)
+ return -1;
+ }
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}