Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Reactive_Flushing_Strategy Class Reference

Implement a flushing strategy that uses the reactor. More...

#include <Reactive_Flushing_Strategy.h>

Inheritance diagram for TAO_Reactive_Flushing_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_Reactive_Flushing_Strategy:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual int schedule_output (TAO_Transport *transport)
 Schedule the transport argument to be flushed. More...

virtual int cancel_output (TAO_Transport *transport)
 Cancel all scheduled output for the transport argument. More...

virtual int flush_message (TAO_Transport *transport, TAO_Queued_Message *msg, ACE_Time_Value *max_wait_time)
 Wait until msg is sent out. Potentially other messages are flushed too, for example, because there are ahead in the queue. More...

virtual int flush_transport (TAO_Transport *transport)
 Wait until the transport has no messages queued. More...


Detailed Description

Implement a flushing strategy that uses the reactor.

Definition at line 28 of file Reactive_Flushing_Strategy.h.


Member Function Documentation

int TAO_Reactive_Flushing_Strategy::cancel_output TAO_Transport   transport [virtual]
 

Cancel all scheduled output for the transport argument.

Implements TAO_Flushing_Strategy.

Definition at line 20 of file Reactive_Flushing_Strategy.cpp.

References TAO_Transport::cancel_output_i.

00021 {
00022   return transport->cancel_output_i ();
00023 }

int TAO_Reactive_Flushing_Strategy::flush_message TAO_Transport   transport,
TAO_Queued_Message   msg,
ACE_Time_Value   max_wait_time
[virtual]
 

Wait until msg is sent out. Potentially other messages are flushed too, for example, because there are ahead in the queue.

Implements TAO_Flushing_Strategy.

Definition at line 26 of file Reactive_Flushing_Strategy.cpp.

References ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, TAO_Queued_Message::all_data_sent, TAO_Transport::orb_core, and TAO_ORB_Core::run.

00029 {
00030   int result = 0;
00031 
00032   // @@ Should we pass this down?  Can we?
00033   ACE_DECLARE_NEW_CORBA_ENV;
00034   ACE_TRY
00035     {
00036       TAO_ORB_Core *orb_core = transport->orb_core ();
00037 
00038       while (!msg->all_data_sent () && result >= 0)
00039         {
00040           result = orb_core->run (max_wait_time, 1 ACE_ENV_ARG_PARAMETER);
00041           ACE_TRY_CHECK;
00042         }
00043     }
00044   ACE_CATCHANY
00045     {
00046       return -1;
00047     }
00048   ACE_ENDTRY;
00049 
00050   return result;
00051 }

int TAO_Reactive_Flushing_Strategy::flush_transport TAO_Transport   transport [virtual]
 

Wait until the transport has no messages queued.

Implements TAO_Flushing_Strategy.

Definition at line 54 of file Reactive_Flushing_Strategy.cpp.

References ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, TAO_Transport::orb_core, TAO_Transport::queue_is_empty, and TAO_ORB_Core::run.

00055 {
00056   // @@ Should we pass this down?  Can we?
00057   ACE_DECLARE_NEW_CORBA_ENV;
00058   ACE_TRY
00059     {
00060       TAO_ORB_Core *orb_core = transport->orb_core ();
00061 
00062       while (!transport->queue_is_empty ())
00063         {
00064           int result = orb_core->run (0, 1 ACE_ENV_ARG_PARAMETER);
00065           ACE_TRY_CHECK;
00066 
00067           if (result == -1)
00068             return -1;
00069         }
00070     }
00071   ACE_CATCHANY
00072     {
00073       return -1;
00074     }
00075   ACE_ENDTRY;
00076 
00077   return 0;
00078 }

int TAO_Reactive_Flushing_Strategy::schedule_output TAO_Transport   transport [virtual]
 

Schedule the transport argument to be flushed.

Implements TAO_Flushing_Strategy.

Definition at line 14 of file Reactive_Flushing_Strategy.cpp.

References TAO_Transport::schedule_output_i.

00015 {
00016   return transport->schedule_output_i ();
00017 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:38:30 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002