Client class (interface)
More...
#include <Client.h>
| virtual bool esnlib::Client::Connect |
( |
const std::string & |
svraddr, |
|
|
int |
svrport |
|
) |
| |
|
pure virtual |
Connect the server
- Parameters
-
| svraddr | The IP of the server |
| svrport | The port of the server |
- Returns
- Return true if connect successfully
| virtual bool esnlib::Client::Connected |
( |
| ) |
|
|
pure virtual |
Check whether the client has connected to the server
- Returns
- Return true if the client has connected to the server
| virtual bool esnlib::Client::EnableSsl |
( |
bool |
needverify = true, |
|
|
const std::string & |
verifyfile = std::string(), |
|
|
const std::string & |
certfile = std::string(), |
|
|
const std::string & |
keyfile = std::string() |
|
) |
| |
|
pure virtual |
Try to enable SSL(Secure Sockets Layer)
- Parameters
-
| needverify | Whether need to verity the certificate |
| verifyfile | The verify file |
| certfile | The Cert. file |
| keyfile | The private key file |
- Returns
- Return true if set up SSL successfully
| virtual SessionPtr esnlib::Client::GetCurrentSession |
( |
| ) |
|
|
pure virtual |
Get current session
- Returns
- The pointer of current session
| virtual std::string esnlib::Client::GetDefaultLocalIp |
( |
| ) |
|
|
pure virtual |
Get the local default IP of the client
- Returns
- The default IP of the client
| virtual IoBufferPtr esnlib::Client::GetFreeBuffer |
( |
int |
bufsize | ) |
|
|
pure virtual |
Get a free buffer from the Buffer Manager
- Parameters
-
| bufsize | The size of the free buffer |
- Returns
- The pointer of the free buffer (IO buffer)
| virtual CommonDataPtr esnlib::Client::GetGlobalData |
( |
| ) |
|
|
pure virtual |
Get the global data of the client
- Returns
- The pointer of the global data
| virtual int esnlib::Client::GetId |
( |
| ) |
|
|
pure virtual |
Get the client's ID
- Returns
- The client ID
| virtual std::string esnlib::Client::GetLocalIp |
( |
| ) |
|
|
pure virtual |
Get the local IP of the client
- Returns
- The IP of the client
| virtual int esnlib::Client::GetLocalPort |
( |
| ) |
|
|
pure virtual |
Get the local port
- Returns
- The port of the client
| virtual std::string esnlib::Client::GetRemoteIp |
( |
| ) |
|
|
pure virtual |
Get the remote server's IP
- Returns
- The IP of the server
| virtual int esnlib::Client::GetRemotePort |
( |
| ) |
|
|
pure virtual |
Get the remote server's port
- Returns
- The port of the server
| virtual bool esnlib::Client::HasGlobalData |
( |
| ) |
|
|
pure virtual |
Check whether the client has global data attached
- Returns
- Return true if the client has global data
| virtual bool esnlib::Client::HasSsl |
( |
| ) |
|
|
pure virtual |
Check whether the client has SSL(Secure Sockets Layer)
- Returns
- Return true if the client has SSL
| virtual bool esnlib::Client::IsConnecting |
( |
| ) |
|
|
pure virtual |
Check whether the client is connecting to the server
- Returns
- Return true if the client is connecting to the server
| virtual void esnlib::Client::SetConnectTimeOut |
( |
int |
seconds | ) |
|
|
pure virtual |
Set connect timeout value
- Parameters
-
| seconds | The value of timeout time (in second) |
| virtual void esnlib::Client::SetId |
( |
int |
id | ) |
|
|
pure virtual |
Set the client's ID
- Parameters
-
| virtual void esnlib::Client::SetIdleTime |
( |
int |
idletype, |
|
|
int |
idletime |
|
) |
| |
|
pure virtual |
Set idle time
- Parameters
-
| idletype | The idle type (1 for read idle, 2 for write idle, 0 for both) |
| idletime | The idle time (in second) |
| virtual void esnlib::Client::SetIoBufferManager |
( |
IoBufferManagerPtr |
manager | ) |
|
|
pure virtual |
Set Buffer Manager (memory pool)
- Parameters
-
| manager | The pointer of the buffer manager |
| virtual void esnlib::Client::SetIoFilter |
( |
IoFilterPtr |
filter | ) |
|
|
pure virtual |
Set IO Filter
- Parameters
-
| filter | The pointer of the filter |
| virtual void esnlib::Client::SetIoHandler |
( |
IoHandlerPtr |
handler | ) |
|
|
pure virtual |
Set IO Handler
- Parameters
-
| handler | The pointer of the handler |
| virtual void esnlib::Client::SetIoServiceManager |
( |
IoServiceManagerPtr |
manager | ) |
|
|
pure virtual |
Set IO Thread Manager (IO thread pool)
- Parameters
-
| manager | The pointer of the IO service manager |
| virtual void esnlib::Client::Write |
( |
IoBufferPtr |
data | ) |
|
|
pure virtual |
Write data to server
- Parameters
-
| data | The data (a buffer pointer) |
| virtual void esnlib::Client::Write |
( |
void * |
data | ) |
|
|
pure virtual |
Write data to server
- Parameters
-
| data | The data (a common pointer) |
The documentation for this class was generated from the following file: