Public Member Functions | Protected Member Functions

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_Reactive_Connect_Strategy::TAO_Reactive_Connect_Strategy ( TAO_ORB_Core orb  ) 

Constructor.

Definition at line 17 of file Reactive_Connect_Strategy.cpp.

  : TAO_Connect_Strategy (orb_core)
{
}

TAO_Reactive_Connect_Strategy::~TAO_Reactive_Connect_Strategy ( void   ) 

Destructor.

Definition at line 23 of file Reactive_Connect_Strategy.cpp.

{
}


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.

{
  if (timeout != 0)
    {
      options.set (ACE_Synch_Options::USE_REACTOR,
                   *timeout);
    }
  else
    {
      // Making it sure it is blocking.
      options.set (ACE_Synch_Options::USE_REACTOR,
                   ACE_Time_Value::zero);
    }
}

int TAO_Reactive_Connect_Strategy::wait_i ( TAO_LF_Event ev,
TAO_Transport t,
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.

{
  int result = 0;
  if (ev == 0)
    return -1;

  if (TAO_debug_level > 2)
    {
      //FUZZ: disable check_for_lack_ACE_OS
      ACE_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("TAO (%P|%t) - Waiting in the Reactor for ")
                  ACE_TEXT ("connection completion - wait ()\n")));
      //FUZZ: enable check_for_lack_ACE_OS
    }

  try
    {
      while (ev->keep_waiting ())
        {
          result =
            this->orb_core_->run (max_wait_time, 1);

          // Did we timeout? If so, stop running the loop.
          if (result == 0 &&
              max_wait_time != 0 &&
              *max_wait_time == ACE_Time_Value::zero)
            {
              errno = ETIME;
              result = -1;
              break;
            }

          // Other errors? If so, stop running the loop.
          if (result == -1)
            break;
        }
    }
  catch (const ::CORBA::Exception&)
    {
      result = -1;
    }

  // Set the result.
  if (result != -1 && ev->error_detected ())
    {
      result = -1;
    }

  return result;
}


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines