TAO_Block_Flushing_Strategy Class Reference

Implement a flushing strategy that blocks on write to flush. More...

#include <Block_Flushing_Strategy.h>

Inheritance diagram for TAO_Block_Flushing_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_Block_Flushing_Strategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual int schedule_output (TAO_Transport *transport)
virtual int cancel_output (TAO_Transport *transport)
 Cancel all scheduled output for the transport argument.
virtual int flush_message (TAO_Transport *transport, TAO_Queued_Message *msg, ACE_Time_Value *max_wait_time)
virtual int flush_transport (TAO_Transport *transport, ACE_Time_Value *max_wait_time)
 Wait until the transport has no messages queued.

Detailed Description

Implement a flushing strategy that blocks on write to flush.

Definition at line 30 of file Block_Flushing_Strategy.h.


Member Function Documentation

int TAO_Block_Flushing_Strategy::cancel_output ( TAO_Transport transport  )  [virtual]

Cancel all scheduled output for the transport argument.

Implements TAO_Flushing_Strategy.

Definition at line 18 of file Block_Flushing_Strategy.cpp.

00019 {
00020   return 0;
00021 }

int TAO_Block_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 24 of file Block_Flushing_Strategy.cpp.

References TAO_Queued_Message::all_data_sent(), and TAO_Transport::handle_output().

00027 {
00028   while (!msg->all_data_sent ())
00029     {
00030       if (transport->handle_output (max_wait_time) == -1)
00031         return -1;
00032     }
00033   return 0;
00034 }

int TAO_Block_Flushing_Strategy::flush_transport ( TAO_Transport transport,
ACE_Time_Value max_wait_time 
) [virtual]

Wait until the transport has no messages queued.

Implements TAO_Flushing_Strategy.

Definition at line 37 of file Block_Flushing_Strategy.cpp.

References TAO_Transport::handle_output(), and TAO_Transport::queue_is_empty().

00039 {
00040   while (!transport->queue_is_empty ())
00041     {
00042       if (transport->handle_output (max_wait_time) == -1)
00043         return -1;
00044     }
00045   return 0;
00046 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_Block_Flushing_Strategy::schedule_output ( TAO_Transport transport  )  [virtual]

Schedule the transport argument to be flushed If -2 is returned then the caller must call one of the flush_* methods. If -1 is returned then there was an error. If 0 is returned then the flush was scheduled successfully.

Implements TAO_Flushing_Strategy.

Definition at line 12 of file Block_Flushing_Strategy.cpp.

00013 {
00014   return MUST_FLUSH;
00015 }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:22 2010 for TAO by  doxygen 1.4.7