LF_Connect_Strategy.cpp

Go to the documentation of this file.
00001 #include "tao/LF_Connect_Strategy.h"
00002 #include "tao/LF_Multi_Event.h"
00003 #include "tao/Connection_Handler.h"
00004 #include "tao/LF_Follower.h"
00005 #include "tao/Leader_Follower.h"
00006 #include "tao/Transport.h"
00007 #include "tao/ORB_Core.h"
00008 #include "ace/Synch_Options.h"
00009 
00010 ACE_RCSID(tao,
00011           LF_Connect_Strategy,
00012           "$Id: LF_Connect_Strategy.cpp 76687 2007-01-29 19:18:13Z johnnyw $")
00013 
00014 
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016 
00017 TAO_LF_Connect_Strategy::TAO_LF_Connect_Strategy (
00018     TAO_ORB_Core *orb_core)
00019   : TAO_Connect_Strategy (orb_core)
00020 {
00021 }
00022 
00023 TAO_LF_Connect_Strategy::~TAO_LF_Connect_Strategy (void)
00024 {
00025 }
00026 
00027 void
00028 TAO_LF_Connect_Strategy::synch_options (ACE_Time_Value *timeout,
00029                                         ACE_Synch_Options &options)
00030 {
00031   if (timeout != 0)
00032     {
00033       options.set (ACE_Synch_Options::USE_REACTOR, *timeout);
00034     }
00035   else
00036     {
00037       // Making it sure it is blocking.
00038       options.set (ACE_Synch_Options::USE_REACTOR, ACE_Time_Value::zero);
00039     }
00040 }
00041 
00042 int
00043 TAO_LF_Connect_Strategy::wait_i (TAO_LF_Event *ev,
00044                                  TAO_Transport *transport,
00045                                  ACE_Time_Value *max_wait_time)
00046 {
00047   if (transport == 0)
00048     return -1;
00049 
00050   TAO_Leader_Follower &leader_follower =
00051     this->orb_core_->leader_follower ();
00052 
00053   int result =
00054     leader_follower.wait_for_event (ev, transport, max_wait_time);
00055 
00056   if (ev->error_detected () && result != -1)
00057     result = -1;
00058 
00059   return result;
00060 }
00061 
00062 
00063 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7