
Public Member Functions | |
| Server () | |
| constructor | |
| 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 *a_pszServer) |
| Set the listen address for this server. | |
| bool | Connect (int a_nTimeout) |
| Attempt to connect to the server. | |
| const char * | GetAddress () const |
| Get the string representation of this server listen address. | |
Private Attributes | |
| char | mAddress [ADDRLEN] |
| server IP:PORT as string | |
| unsigned long | mIp |
| server IP address | |
| int | mPort |
| server port | |
| time_t | mLastConnect |
| last connection time | |
Static Private Attributes | |
| static const size_t | ADDRLEN = sizeof("aaa.bbb.ccc.ddd:PPPPP") |
| max length of a server address | |
Definition at line 323 of file MemCacheClient.cpp.
| MemCacheClient::Server::Server | ( | const Server & | rhs | ) | [inline] |
copy constructor
| rhs | server to copy address of |
Definition at line 335 of file MemCacheClient.cpp.
References ServerSocket::operator=().
| MemCacheClient::Server & MemCacheClient::Server::operator= | ( | const Server & | rhs | ) |
copy operator
| rhs | server to copy server listen address from |
Definition at line 386 of file MemCacheClient.cpp.
References mAddress, mIp, mLastConnect, and mPort.
| bool MemCacheClient::Server::operator== | ( | const Server & | rhs | ) | const |
equality based on server listen address
| rhs | server to compare to |
Definition at line 398 of file MemCacheClient.cpp.
| bool MemCacheClient::Server::operator!= | ( | const Server & | rhs | ) | const [inline] |
inequality based on server listen address
| rhs | server to compare to |
Definition at line 355 of file MemCacheClient.cpp.
| bool MemCacheClient::Server::Set | ( | const char * | a_pszServer | ) |
Set the listen address for this server.
| a_pszServer | Listen address in IP:PORT format |
Definition at line 406 of file MemCacheClient.cpp.
References ADDRLEN, mAddress, mIp, and mPort.
Referenced by MemCacheClient::AddServer(), MemCacheClient::DelServer(), and MemCacheClient::FlushAll().
| bool MemCacheClient::Server::Connect | ( | int | a_nTimeout | ) |
Attempt to connect to the server.
| a_nTimeout | Timeout for connection in milliseconds |
Definition at line 434 of file MemCacheClient.cpp.
References ServerSocket::Connect(), ServerSocket::IsConnected(), MEMCACHECLIENT_RECONNECT_SEC, mIp, mLastConnect, and mPort.
Referenced by MemCacheClient::FindServer(), and MemCacheClient::FlushAll().
| const char* MemCacheClient::Server::GetAddress | ( | ) | const [inline] |
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 376 of file MemCacheClient.cpp.
Referenced by MemCacheClient::AddServer().
1.5.6