diff options
author | johnc <johnc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-02-11 22:14:39 +0000 |
---|---|---|
committer | johnc <johnc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-02-11 22:14:39 +0000 |
commit | 8e39e6bc40af6f0f4257ef4f39b20d57915c9aa0 (patch) | |
tree | 1bc7d70bcc2ef12241e11a893c394acc17f8640a /TAO/tao/Reactive_Flushing_Strategy.cpp | |
parent | dfd658c5f37c16e273f3f47a0d9fbdaaea23de3b (diff) | |
download | ATCD-8e39e6bc40af6f0f4257ef4f39b20d57915c9aa0.tar.gz |
ChangeLogTag: Mon Feb 11 20:51:59 UTC 2008 Ciju John <johnc at ociweb dot com>
Diffstat (limited to 'TAO/tao/Reactive_Flushing_Strategy.cpp')
-rw-r--r-- | TAO/tao/Reactive_Flushing_Strategy.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/TAO/tao/Reactive_Flushing_Strategy.cpp b/TAO/tao/Reactive_Flushing_Strategy.cpp index 312b955192b..9a9bb0f4954 100644 --- a/TAO/tao/Reactive_Flushing_Strategy.cpp +++ b/TAO/tao/Reactive_Flushing_Strategy.cpp @@ -6,6 +6,8 @@ #include "tao/ORB_Core.h" #include "tao/Queued_Message.h" +#include "ace/High_Res_Timer.h" + ACE_RCSID (tao, Reactive_Flushing_Strategy, "$Id$") @@ -40,6 +42,13 @@ TAO_Reactive_Flushing_Strategy::flush_message (TAO_Transport *transport, while (!msg->all_data_sent () && result >= 0) { result = orb_core->run (max_wait_time, 1); + + if (max_wait_time != 0) { + if (*max_wait_time <= ACE_Time_Value::zero) { + errno = ETIME; + result = -1; + } + } } } catch (const ::CORBA::Exception&) @@ -51,17 +60,24 @@ TAO_Reactive_Flushing_Strategy::flush_message (TAO_Transport *transport, } int -TAO_Reactive_Flushing_Strategy::flush_transport (TAO_Transport *transport) +TAO_Reactive_Flushing_Strategy::flush_transport (TAO_Transport *transport + , ACE_Time_Value *max_wait_time) { - // @@ Should we pass this down? Can we? try { TAO_ORB_Core * const orb_core = transport->orb_core (); while (!transport->queue_is_empty ()) { - if (orb_core->run (0, 1) == -1) + if (orb_core->run (max_wait_time, 1) == -1) return -1; + + if (max_wait_time != 0) { + if (*max_wait_time <= ACE_Time_Value::zero) { + errno = ETIME; + return -1; + } + } } } catch (const ::CORBA::Exception&) |