summaryrefslogtreecommitdiff
path: root/TAO/tao/Connect_Strategy.cpp
blob: 903cb869b87f984558bcf505b85dce02a0c6bd8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// -*- C++ -*-
#include "tao/Connect_Strategy.h"
#include "tao/Transport.h"
#include "tao/Connection_Handler.h"
#include "tao/LF_Multi_Event.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_Connect_Strategy::TAO_Connect_Strategy (TAO_ORB_Core *orb_core)
  : orb_core_ (orb_core)
{
}

int
TAO_Connect_Strategy::wait (TAO_Connection_Handler *ch,
                            ACE_Time_Value *max_wait_time)
{
  if (ch == nullptr)
    return -1;

  return this->wait_i (ch, ch->transport (), max_wait_time);
}

int
TAO_Connect_Strategy::wait (TAO_Transport *t, ACE_Time_Value *max_wait_time)
{
  // Basically the connection was EINPROGRESS, but before we could
  // wait for it some other thread detected a failure and cleaned up
  // the connection handler.
  if (t == nullptr)
    return -1;

  return this->wait_i (t->connection_handler (), t, max_wait_time);
}

int
TAO_Connect_Strategy::wait (TAO_LF_Multi_Event *mev,
                            ACE_Time_Value *max_wait_time)
{
  return this->wait_i (mev, mev->base_transport (), max_wait_time);
}

int
TAO_Connect_Strategy::poll (TAO_LF_Multi_Event *mev)
{
  ACE_Time_Value zero (ACE_Time_Value::zero);
  return this->wait_i (mev, mev->base_transport (), &zero);
}

TAO_END_VERSIONED_NAMESPACE_DECL