00001 // $Id: Block_Flushing_Strategy.cpp 80603 2008-02-11 22:14:39Z johnc $ 00002 00003 #include "tao/Block_Flushing_Strategy.h" 00004 #include "tao/Transport.h" 00005 #include "tao/Queued_Message.h" 00006 00007 ACE_RCSID(tao, Block_Flushing_Strategy, "$Id: Block_Flushing_Strategy.cpp 80603 2008-02-11 22:14:39Z johnc $") 00008 00009 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00010 00011 int 00012 TAO_Block_Flushing_Strategy::schedule_output (TAO_Transport *) 00013 { 00014 return MUST_FLUSH; 00015 } 00016 00017 int 00018 TAO_Block_Flushing_Strategy::cancel_output (TAO_Transport *) 00019 { 00020 return 0; 00021 } 00022 00023 int 00024 TAO_Block_Flushing_Strategy::flush_message (TAO_Transport *transport, 00025 TAO_Queued_Message *msg, 00026 ACE_Time_Value *max_wait_time) 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 } 00035 00036 int 00037 TAO_Block_Flushing_Strategy::flush_transport (TAO_Transport *transport 00038 , ACE_Time_Value *max_wait_time) 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 } 00047 00048 TAO_END_VERSIONED_NAMESPACE_DECL