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

TAO_Wait_On_Read Class Reference

#include <Wait_On_Read.h>

Inheritance diagram for TAO_Wait_On_Read:

Inheritance graph
[legend]
Collaboration diagram for TAO_Wait_On_Read:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Wait_On_Read (TAO_Transport *transport)
 Constructor. More...

virtual ~TAO_Wait_On_Read (void)
 Destructor. More...

virtual int wait (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd)
 Base class virtual method. Wait till the <reply_received> flag is true or the time expires. More...

virtual int register_handler (void)
 Register the handler needs with the reactor provided that it makes sense for the strategy. More...

virtual int non_blocking (void)
 Returns a value to indicate whether the transport needs to set the socket on which it is waiting to non-blocking mode or not. More...


Detailed Description

Simply block on read() to wait for the reply.

Definition at line 30 of file Wait_On_Read.h.


Constructor & Destructor Documentation

TAO_Wait_On_Read::TAO_Wait_On_Read TAO_Transport   transport
 

Constructor.

Definition at line 12 of file Wait_On_Read.cpp.

00013   : TAO_Wait_Strategy (transport)
00014 {
00015 }

TAO_Wait_On_Read::~TAO_Wait_On_Read void    [virtual]
 

Destructor.

Definition at line 18 of file Wait_On_Read.cpp.

00019 {
00020 }


Member Function Documentation

int TAO_Wait_On_Read::non_blocking void    [virtual]
 

Returns a value to indicate whether the transport needs to set the socket on which it is waiting to non-blocking mode or not.

Implements TAO_Wait_Strategy.

Definition at line 78 of file Wait_On_Read.cpp.

00079 {
00080   return 0;
00081 }

int TAO_Wait_On_Read::register_handler void    [virtual]
 

Register the handler needs with the reactor provided that it makes sense for the strategy.

Implements TAO_Wait_Strategy.

Definition at line 72 of file Wait_On_Read.cpp.

00073 {
00074   return 0;
00075 }

int TAO_Wait_On_Read::wait ACE_Time_Value   max_wait_time,
TAO_Synch_Reply_Dispatcher   rd
[virtual]
 

Base class virtual method. Wait till the <reply_received> flag is true or the time expires.

Implements TAO_Wait_Strategy.

Definition at line 24 of file Wait_On_Read.cpp.

References TAO_Transport::close_connection, TAO_LF_Invocation_Event::error_detected, TAO_Transport::handle_input_i, TAO_LF_Event::keep_waiting, TAO_LF_Event::LFS_ACTIVE, TAO_LF_Event::state_changed, TAO_LF_Invocation_Event::successful, and TAO_Wait_Strategy::transport_.

00026 {
00027   // Start the count down timer to account for the time spent in this
00028   // method.
00029   ACE_Countdown_Time countdown (max_wait_time);
00030 
00031   rd.state_changed (TAO_LF_Event::LFS_ACTIVE);
00032 
00033   // Do the same sort of looping that is done in other wait
00034   // strategies.
00035   int retval = 0;
00036   TAO_Resume_Handle rh;
00037   while (1)
00038     {
00039       retval =
00040         this->transport_->handle_input_i (rh,
00041                                           max_wait_time,
00042                                           1);
00043 
00044       // If we got our reply, no need to run the loop any
00045       // further.
00046       if (!rd.keep_waiting ())
00047         break;
00048 
00049       // @@ We are not checking for timeouts here...
00050 
00051       // If we got an error just break
00052       if (retval == -1)
00053         break;
00054     }
00055 
00056   if (rd.error_detected () == -1 || retval == -1)
00057     {
00058       this->transport_->close_connection ();
00059     }
00060 
00061   if (rd.successful ())
00062     return 0;
00063 
00064   if (rd.error_detected ())
00065     return -1;
00066 
00067   return 1;
00068 }


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