summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.i
blob: 5d4949977677d1bfe6afe45460edaa5a0156172f (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//
// $Id$
//

ACE_INLINE
TAO_ECG_UDP_Out_Endpoint::TAO_ECG_UDP_Out_Endpoint (void)
  : port_number_ (0),
    if_count_ (0),
    ifs_ (0)
{
}

ACE_INLINE ACE_SOCK_Dgram&
TAO_ECG_UDP_Out_Endpoint::dgram (void)
{
  return this->dgram_;
}

ACE_INLINE CORBA::ULong
TAO_ECG_UDP_Out_Endpoint::next_request_id (void)
{
  return this->request_id_generator_++;
}

// ****************************************************************

ACE_INLINE ACE_SOCK_Dgram&
TAO_ECG_UDP_Sender::dgram (void)
{
  return this->endpoint_->dgram ();
}

ACE_INLINE CORBA::ULong
TAO_ECG_UDP_Sender::mtu (void) const
{
  return this->mtu_;
}

// ****************************************************************

ACE_INLINE
TAO_ECG_UDP_Request_Index::TAO_ECG_UDP_Request_Index (void)
  : request_id (0)
{
}

ACE_INLINE
TAO_ECG_UDP_Request_Index::TAO_ECG_UDP_Request_Index (const ACE_INET_Addr& from_,
                                                      CORBA::ULong request_id_)
  :  from (from_),
     request_id (request_id_)
{
}

ACE_INLINE u_long
TAO_ECG_UDP_Request_Index::hash (void) const
{
  return ((from.get_ip_address() << 24)
          | (from.get_port_number () << 8)
          | (request_id & 0x000000ff));
}

ACE_INLINE int
TAO_ECG_UDP_Request_Index::operator== (const TAO_ECG_UDP_Request_Index& rhs) const
{
  return (this->from == rhs.from && 
          this->request_id == rhs.request_id);
}

ACE_INLINE int
TAO_ECG_UDP_Request_Index::operator!= (const TAO_ECG_UDP_Request_Index& rhs) const
{
  return !(*this == rhs);
}

// ****************************************************************

void
TAO_ECG_UDP_Request_Entry::inc_timeout (void)
{
  this->timeout_counter_++;
}

int
TAO_ECG_UDP_Request_Entry::get_timeout (void) const
{
  return this->timeout_counter_;
}