Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tao / Connect_Strategy.cpp
blob903cb869b87f984558bcf505b85dce02a0c6bd8a
1 // -*- C++ -*-
2 #include "tao/Connect_Strategy.h"
3 #include "tao/Transport.h"
4 #include "tao/Connection_Handler.h"
5 #include "tao/LF_Multi_Event.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO_Connect_Strategy::TAO_Connect_Strategy (TAO_ORB_Core *orb_core)
10 : orb_core_ (orb_core)
14 int
15 TAO_Connect_Strategy::wait (TAO_Connection_Handler *ch,
16 ACE_Time_Value *max_wait_time)
18 if (ch == nullptr)
19 return -1;
21 return this->wait_i (ch, ch->transport (), max_wait_time);
24 int
25 TAO_Connect_Strategy::wait (TAO_Transport *t, ACE_Time_Value *max_wait_time)
27 // Basically the connection was EINPROGRESS, but before we could
28 // wait for it some other thread detected a failure and cleaned up
29 // the connection handler.
30 if (t == nullptr)
31 return -1;
33 return this->wait_i (t->connection_handler (), t, max_wait_time);
36 int
37 TAO_Connect_Strategy::wait (TAO_LF_Multi_Event *mev,
38 ACE_Time_Value *max_wait_time)
40 return this->wait_i (mev, mev->base_transport (), max_wait_time);
43 int
44 TAO_Connect_Strategy::poll (TAO_LF_Multi_Event *mev)
46 ACE_Time_Value zero (ACE_Time_Value::zero);
47 return this->wait_i (mev, mev->base_transport (), &zero);
50 TAO_END_VERSIONED_NAMESPACE_DECL