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 Member Functions

 TAO_Reactive_Connect_Strategy (TAO_ORB_Core *orb)
 Constructor.

 ~TAO_Reactive_Connect_Strategy (void)
 Destructor.

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


Protected Member Functions

virtual int wait_i (TAO_LF_Event *ch, TAO_Transport *, ACE_Time_Value *val)
 This is the method that does all the real interesting stuff.


Detailed Description

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

Definition at line 38 of file Reactive_Connect_Strategy.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Reactive_Connect_Strategy::TAO_Reactive_Connect_Strategy TAO_ORB_Core orb  ) 
 

Constructor.

Definition at line 17 of file Reactive_Connect_Strategy.cpp.

00019   : TAO_Connect_Strategy (orb_core)
00020 {
00021 }

TAO_Reactive_Connect_Strategy::~TAO_Reactive_Connect_Strategy void   ) 
 

Destructor.

Definition at line 23 of file Reactive_Connect_Strategy.cpp.

00024 {
00025 }


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 28 of file Reactive_Connect_Strategy.cpp.

References ACE_Synch_Options::set().

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

int TAO_Reactive_Connect_Strategy::wait_i TAO_LF_Event ch,
TAO_Transport ,
ACE_Time_Value val
[protected, virtual]
 

This is the method that does all the real interesting stuff.

Implements TAO_Connect_Strategy.

Definition at line 45 of file Reactive_Connect_Strategy.cpp.

References ACE_CATCHANY, ACE_DEBUG, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, TAO_LF_Event::error_detected(), ETIME, TAO_LF_Event::keep_waiting(), LM_DEBUG, TAO_ORB_Core::run(), and TAO_debug_level.

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


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:23:23 2006 for TAO by doxygen 1.3.6