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

TAO_Reactive_Connect_Strategy Class Reference

Concrete implementation of a connect strategy that waits on the reactor during asynch connects. More...

#include <Reactive_Connect_Strategy.h>

Inheritance diagram for TAO_Reactive_Connect_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_Reactive_Connect_Strategy:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Reactive_Connect_Strategy (TAO_ORB_Core *orb)
 Constructor. More...

 ~TAO_Reactive_Connect_Strategy (void)
 Destructor. More...

virtual void synch_options (ACE_Time_Value *val, ACE_Synch_Options &opt)
 Obtain the synch options that can be passed to ACE_Connector. More...

virtual int wait (TAO_Connection_Handler *ch, ACE_Time_Value *val)
 Wait for the connection to be completed till a timeout occurs. More...


Detailed Description

Concrete implementation of a connect strategy that waits on the reactor during asynch connects.

Definition at line 34 of file Reactive_Connect_Strategy.h.


Constructor & Destructor Documentation

TAO_Reactive_Connect_Strategy::TAO_Reactive_Connect_Strategy TAO_ORB_Core   orb
 

Constructor.

Definition at line 14 of file Reactive_Connect_Strategy.cpp.

00016   : TAO_Connect_Strategy (orb_core)
00017 {
00018 }

TAO_Reactive_Connect_Strategy::~TAO_Reactive_Connect_Strategy void   
 

Destructor.

Definition at line 20 of file Reactive_Connect_Strategy.cpp.

00021 {
00022 }


Member Function Documentation

void TAO_Reactive_Connect_Strategy::synch_options ACE_Time_Value   val,
ACE_Synch_Options   opt
[virtual]
 

Obtain the synch options that can be passed to ACE_Connector.

Implements TAO_Connect_Strategy.

Definition at line 25 of file Reactive_Connect_Strategy.cpp.

References ACE_Synch_Options::set, ACE_Synch_Options::USE_REACTOR, and ACE_Time_Value::zero.

00027 {
00028   if (timeout != 0)
00029     {
00030       options.set (ACE_Synch_Options::USE_REACTOR,
00031                    *timeout);
00032     }
00033   else
00034     {
00035       // Making it sure it is blocking.
00036       options.set (ACE_Synch_Options::USE_REACTOR,
00037                    ACE_Time_Value::zero);
00038     }
00039 }

int TAO_Reactive_Connect_Strategy::wait TAO_Connection_Handler   ch,
ACE_Time_Value   val
[virtual]
 

Wait for the connection to be completed till a timeout occurs.

Implements TAO_Connect_Strategy.

Definition at line 43 of file Reactive_Connect_Strategy.cpp.

References ACE_CATCHANY, ACE_DEBUG, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_LIB_TEXT, ACE_TRY, ACE_TRY_CHECK, TAO_LF_CH_Event::error_detected, ETIME, TAO_LF_Event::keep_waiting, LM_DEBUG, TAO_Connect_Strategy::orb_core_, TAO_ORB_Core::run, and ACE_Time_Value::zero.

00045 {
00046   if (TAO_debug_level > 2)
00047     ACE_DEBUG ((LM_DEBUG,
00048                 ACE_LIB_TEXT ("(%P|%t) Waiting in the Reactor for")
00049                 ACE_LIB_TEXT (" connection completion - wait () \n")));
00050 
00051   int result = 0;
00052 
00053   ACE_DECLARE_NEW_CORBA_ENV;
00054   ACE_TRY
00055     {
00056       while (ch->keep_waiting ())
00057         {
00058           result =
00059             this->orb_core_->run (max_wait_time, 1 ACE_ENV_ARG_PARAMETER);
00060           ACE_TRY_CHECK;
00061 
00062           // Did we timeout? If so, stop running the loop.
00063           if (result == 0 &&
00064               max_wait_time != 0 &&
00065               *max_wait_time == ACE_Time_Value::zero)
00066             {
00067               errno = ETIME;
00068               result = -1;
00069               break;
00070             }
00071 
00072           // Other errors? If so, stop running the loop.
00073           if (result == -1)
00074             break;
00075         }
00076     }
00077   ACE_CATCHANY
00078     {
00079       result = -1;
00080     }
00081   ACE_ENDTRY;
00082 
00083   // Set the result.
00084   if (ch->error_detected () && result != -1)
00085     result = -1;
00086 
00087   return result;
00088 }


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