1 #include "tao/Block_Flushing_Strategy.h"
2 #include "tao/Transport.h"
3 #include "tao/Queued_Message.h"
4 #include "tao/Connection_Handler.h"
5 #include "tao/ORB_Time_Policy.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
10 TAO_Block_Flushing_Strategy::schedule_output (TAO_Transport
*)
16 TAO_Block_Flushing_Strategy::cancel_output (TAO_Transport
*)
22 TAO_Block_Flushing_Strategy::call_handle_output (TAO_Transport
*transport
,
23 const TAO::Transport::Drain_Constraints
&dc
)
25 switch (transport
->handle_output (dc
).dre_
)
27 case TAO_Transport::DR_ERROR
: return -1;
28 case TAO_Transport::DR_QUEUE_EMPTY
: // won't happen, fall-through anyway
29 case TAO_Transport::DR_OK
: return 0;
30 case TAO_Transport::DR_WOULDBLOCK
:
32 TAO::ORB_Countdown_Time
counter (dc
.timeout ());
33 TAO_Connection_Handler
&ch
= *transport
->connection_handler ();
34 if (ch
.handle_write_ready (dc
.timeout ()) == -1)
45 TAO_Block_Flushing_Strategy::flush_message (TAO_Transport
*transport
,
46 TAO_Queued_Message
*msg
,
47 ACE_Time_Value
*max_wait_time
)
49 TAO::Transport::Drain_Constraints
dc (max_wait_time
, true);
50 while (!msg
->all_data_sent ())
52 if (this->call_handle_output (transport
, dc
) == -1)
59 TAO_Block_Flushing_Strategy::flush_transport (TAO_Transport
*transport
,
60 ACE_Time_Value
*max_wait_time
)
62 TAO::Transport::Drain_Constraints
dc (max_wait_time
, true);
63 while (!transport
->queue_is_empty ())
65 if (this->call_handle_output (transport
, dc
) == -1)
71 TAO_END_VERSIONED_NAMESPACE_DECL