|
MemCacheClient
|
Abstraction of a server connection. More...
Private Types | |
| enum | ConnectResult { CONNECT_SUCCESS, CONNECT_FAILED, CONNECT_WAITING } |
Private Member Functions | |
| D | mIp (INADDR_NONE) |
| D | mPort (0) |
| D | mLastConnect (0) |
| Server (const Server &rhs) | |
| copy constructor | |
| ~Server () | |
| destructor | |
| Server & | operator= (const Server &rhs) |
| copy operator | |
| bool | operator== (const Server &rhs) const |
| equality based on server listen address | |
| bool | operator!= (const Server &rhs) const |
| inequality based on server listen address | |
| bool | Set (const char *aServer) |
| Set the listen address for this server. | |
| ConnectResult | Connect (size_t aTimeout, size_t aRetryPeriod) |
| Attempt to connect to the server. | |
| const char * | GetAddress () const |
| Get the string representation of this server listen address. | |
| int | GetPort () const |
| Get the listen port for this server. | |
Private Attributes | |
| D | __pad0__:/src/MemCacheClient/MemCacheClient.cpp" 2"D:/src/MemCacheClient/MemCacheClient.cpp" 2public: Server(const ClTrace & aTrace) : Socket(aTrace) |
| char | mAddress [ADDRLEN] |
| server IP:PORT as string | |
| unsigned long | mIp |
| server IP address | |
| int | mPort |
| server port | |
| unsigned long | mLastConnect |
| last connection time | |
Static Private Attributes | |
| static const size_t | ADDRLEN = sizeof("aaa.bbb.ccc.ddd:PPPPP") |
| max length of a server address | |
Abstraction of a server connection.
Definition at line 42 of file MemCacheClient.cpp.
| MemCacheClient::Server::Server | ( | const Server & | rhs | ) | [inline, private] |
copy constructor
| rhs | server to copy address of |
Definition at line 60 of file MemCacheClient.cpp.
| MemCacheClient::Server::ConnectResult MemCacheClient::Server::Connect | ( | size_t | aTimeout, |
| size_t | aRetryPeriod | ||
| ) | [private] |
Attempt to connect to the server.
| aTimeout | Timeout for connection in milliseconds |
Definition at line 169 of file MemCacheClient.cpp.
References Socket::Connect(), and Socket::IsConnected().
Referenced by MemCacheClient::FindServer(), and MemCacheClient::FlushAll().
| const char* MemCacheClient::Server::GetAddress | ( | ) | const [inline, private] |
Get the string representation of this server listen address.
This may not be the same as the address passed in. It will always be in the format IP:PORT.
Definition at line 103 of file MemCacheClient.cpp.
Referenced by MemCacheClient::AddServer(), MemCacheClient::Combine(), MemCacheClient::DumpTables(), MemCacheClient::IncDec(), MemCacheClient::ConsistentHash::operator<(), and MemCacheClient::Store().
| bool MemCacheClient::Server::operator!= | ( | const Server & | rhs | ) | const [inline, private] |
inequality based on server listen address
| rhs | server to compare to |
Definition at line 80 of file MemCacheClient.cpp.
| MemCacheClient::Server & MemCacheClient::Server::operator= | ( | const Server & | rhs | ) | [private] |
copy operator
| rhs | server to copy server listen address from |
Definition at line 117 of file MemCacheClient.cpp.
References mAddress, mIp, mLastConnect, mPort, and Socket::mTrace.
| bool MemCacheClient::Server::operator== | ( | const Server & | rhs | ) | const [private] |
equality based on server listen address
| rhs | server to compare to |
Definition at line 132 of file MemCacheClient.cpp.
| bool MemCacheClient::Server::Set | ( | const char * | aServer | ) | [private] |
Set the listen address for this server.
| aServer | Listen address in IP:PORT format |
Definition at line 140 of file MemCacheClient.cpp.
Referenced by MemCacheClient::AddServer(), MemCacheClient::DelServer(), and MemCacheClient::FlushAll().
1.7.3