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

TAO_LF_Connect_Strategy Class Reference

Concrete implementation of a connect strategy that waits on the leader-follower during asynch connects. More...

#include <LF_Connect_Strategy.h>

Inheritance diagram for TAO_LF_Connect_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_LF_Connect_Strategy:

Collaboration graph
[legend]
List of all members.

Public Methods

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

 ~TAO_LF_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 leader-follower during asynch connects.

Definition at line 34 of file LF_Connect_Strategy.h.


Constructor & Destructor Documentation

TAO_LF_Connect_Strategy::TAO_LF_Connect_Strategy TAO_ORB_Core   orb
 

Constructor.

Definition at line 17 of file LF_Connect_Strategy.cpp.

00019   : TAO_Connect_Strategy (orb_core)
00020 {
00021 }

TAO_LF_Connect_Strategy::~TAO_LF_Connect_Strategy void   
 

Destructor.

Definition at line 23 of file LF_Connect_Strategy.cpp.

00024 {
00025 }


Member Function Documentation

void TAO_LF_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 LF_Connect_Strategy.cpp.

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

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_LF_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 46 of file LF_Connect_Strategy.cpp.

References ACE_ASSERT, TAO_ORB_Core::leader_follower, TAO_Connect_Strategy::orb_core_, TAO_LF_CH_Event::successful, TAO_Connection_Handler::transport, and TAO_Leader_Follower::wait_for_event.

00048 {
00049   ACE_ASSERT(ch != 0);
00050 
00051   // @@todo We need to use a auto_ptr<>-like object here!
00052   // TAO_Transport * transport = ch->get_transport_locked();
00053   TAO_Transport *transport = ch->transport ();
00054 
00055   // Basically the connection was EINPROGRESS, but before we could
00056   // wait for it some other thread detected a failure and cleaned up
00057   // the connection handler.
00058   if(transport == 0)
00059     {
00060       return -1;
00061     }
00062 
00063   TAO_Leader_Follower &leader_follower =
00064     this->orb_core_->leader_follower ();
00065 
00066   int result =
00067     leader_follower.wait_for_event (ch,
00068                                     transport,
00069                                     max_wait_time);
00070 
00071   // Set the result.
00072   if (!ch->successful () && result != -1)
00073     result = -1;
00074 
00075   // @@todo We need to use a auto_ptr<>-like object here!
00076   // TAO_Transport::release(transport);
00077 
00078   return result;
00079 }


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