diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-24 08:02:58 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-24 08:02:58 +0000 |
commit | e588f487fe14b34a642a62bd0cb53877a42b4793 (patch) | |
tree | 8c0bc2f7aa508472a4fd98dfca9d6afd60130f52 /TAO/tao/Reactive_Flushing_Strategy.cpp | |
parent | ad7f2d4ae4273710073d841fe5afccaf14e6718a (diff) | |
download | ATCD-e588f487fe14b34a642a62bd0cb53877a42b4793.tar.gz |
ChangeLogTag:Tue Apr 24 00:21:54 2001 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao/Reactive_Flushing_Strategy.cpp')
-rw-r--r-- | TAO/tao/Reactive_Flushing_Strategy.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/TAO/tao/Reactive_Flushing_Strategy.cpp b/TAO/tao/Reactive_Flushing_Strategy.cpp new file mode 100644 index 00000000000..0bbc18bf46b --- /dev/null +++ b/TAO/tao/Reactive_Flushing_Strategy.cpp @@ -0,0 +1,77 @@ +// -*- C++ -*- +// $Id$ + +#include "Reactive_Flushing_Strategy.h" +#include "Transport.h" +#include "ORB_Core.h" +#include "Queued_Message.h" +#include "debug.h" + +ACE_RCSID(tao, Reactive_Flushing_Strategy, "$Id$") + +int +TAO_Reactive_Flushing_Strategy::schedule_output (TAO_Transport *transport) +{ + return transport->schedule_output_i (); +} + +int +TAO_Reactive_Flushing_Strategy::cancel_output (TAO_Transport *transport) +{ + return transport->cancel_output_i (); +} + +int +TAO_Reactive_Flushing_Strategy::flush_message (TAO_Transport *transport, + TAO_Queued_Message *msg, + ACE_Time_Value *max_wait_time) +{ + int result = 0; + + // @@ Should we pass this down? Can we? + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + TAO_ORB_Core *orb_core = transport->orb_core (); + + while (!msg->all_data_sent () && result >= 0) + { + result = orb_core->run (max_wait_time, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + return -1; + } + ACE_ENDTRY; + + return result; +} + +int +TAO_Reactive_Flushing_Strategy::flush_transport (TAO_Transport *transport) +{ + // @@ Should we pass this down? Can we? + 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; +} |