blob: ad7350c7ced6535e0aed8b14a01d3a30b4abe6a7 (
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
|
// $Id$
#include "ace/INet/ClientRequestHandler.h"
#include "ace/Functor_String.h"
#if !defined (__ACE_INLINE__)
#include "ace/INet/ClientRequestHandler.inl"
#endif
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE
{
namespace INet
{
ClientRequestHandler::ClientRequestHandler () {}
ClientRequestHandler::~ClientRequestHandler () {}
ConnectionCache& ClientRequestHandler::connection_cache ()
{
return *TConnectionCacheSingleton::instance ();
}
ClientINetRequestHandler::ClientINetRequestHandler () {}
ClientINetRequestHandler::~ClientINetRequestHandler () {}
ClientINetRequestHandler::INetConnectionKey::INetConnectionKey (
const ACE_CString& host,
u_short port)
: ConnectionKey (),
host_ (host),
port_ (port)
{
}
ClientINetRequestHandler::INetConnectionKey::~INetConnectionKey ()
{}
u_long ClientINetRequestHandler::INetConnectionKey::hash () const
{
return ACE_Hash<ACE_CString>()(this->host_) + this->port_;
}
ConnectionKey* ClientINetRequestHandler::INetConnectionKey::duplicate () const
{
ConnectionKey* k = 0;
ACE_NEW_RETURN (k,
INetConnectionKey (this->host_, this->port_),
0);
return k;
}
bool ClientINetRequestHandler::INetConnectionKey::equal (const ConnectionKey& key) const
{
try {
const INetConnectionKey& ikey = dynamic_cast<const INetConnectionKey&> (key);
return this->host_ == ikey.host_ && this->port_ == ikey.port_;
}
catch (...) {
return false;
}
}
}
}
ACE_END_VERSIONED_NAMESPACE_DECL
|