summaryrefslogtreecommitdiff
path: root/TAO/tao/Connect_Strategy.cpp
blob: 9a79bece571152700e52a25186a1188f1da70339 (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
51
52
53
54
55
56
57
58
59
#include "tao/Connect_Strategy.h"
#include "tao/Transport.h"
#include "tao/Connection_Handler.h"
#include "tao/LF_Multi_Event.h"

ACE_RCSID (tao,
           Connect_Strategy,
           "$Id$")

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

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


TAO_Connect_Strategy::~TAO_Connect_Strategy (void)
{
}

int
TAO_Connect_Strategy::wait (TAO_Connection_Handler *ch,
                            ACE_Time_Value *max_wait_time)
{
  if (ch == 0)
    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 == 0)
    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