Session class (interface)
More...
#include <Session.h>
Session class (interface)
| virtual void esnlib::Session::Broadcast |
( |
boost::shared_ptr< IoBuffer > |
data | ) |
|
|
pure virtual |
Broadcast data
- Parameters
-
| data | The data (a buffer pointer) |
| virtual void esnlib::Session::Broadcast |
( |
void * |
data | ) |
|
|
pure virtual |
Broadcast data
- Parameters
-
| data | The data (a common pointer) |
| virtual void esnlib::Session::Close |
( |
bool |
rightnow = true | ) |
|
|
pure virtual |
Close the session
- Parameters
-
| rightnow | Whether close the session immediately |
| virtual bool esnlib::Session::Connected |
( |
| ) |
|
|
pure virtual |
Check whether the valid connection of the session is created
- Returns
- Return true if the connection is created
| virtual void* esnlib::Session::DecodeBuffer |
( |
boost::shared_ptr< IoBuffer > |
data | ) |
|
|
pure virtual |
Decode buffer
- Parameters
-
| data | The pointer of the encoded buffer (IO buffer) |
- Returns
- The original buffer (a common pointer)
| virtual boost::shared_ptr<IoBuffer> esnlib::Session::EncodeBuffer |
( |
void * |
data | ) |
|
|
pure virtual |
Encode buffer
- Parameters
-
| data | The buffer (a common pointer) |
- Returns
- The pointer of the encoded buffer (IO buffer)
| virtual CommonDataPtr esnlib::Session::GetData |
( |
| ) |
|
|
pure virtual |
Get the local data of the session
- Returns
- The pointer of the local data
| virtual boost::shared_ptr<IoBuffer> esnlib::Session::GetFreeBuffer |
( |
int |
bufsize | ) |
|
|
pure virtual |
Get a free buffer
- Parameters
-
| bufsize | The size of the free buffer |
- Returns
- The pointer of the free buffer (IO buffer)
| virtual CommonDataPtr esnlib::Session::GetGlobalData |
( |
| ) |
|
|
pure virtual |
Get the global data of the session
- Returns
- The pointer of the global data
| virtual int esnlib::Session::GetId |
( |
| ) |
|
|
pure virtual |
Get the session's ID
- Returns
- The session ID
| virtual boost::shared_ptr<IoFilter> esnlib::Session::GetIoFilter |
( |
| ) |
|
|
pure virtual |
Get the IO filter
- Returns
- The pointer of the IO filter
| virtual boost::shared_ptr<IoHandler> esnlib::Session::GetIoHandler |
( |
| ) |
|
|
pure virtual |
Get the IO handler
- Returns
- The pointer of the IO handler
| virtual std::string esnlib::Session::GetLocalIp |
( |
| ) |
|
|
pure virtual |
Get the local IP of the session
- Returns
- The local IP of the session
| virtual int esnlib::Session::GetLocalPort |
( |
| ) |
|
|
pure virtual |
Get the port of the local side
- Returns
- The port of the local side
| virtual int esnlib::Session::GetMaxMessageQueueSize |
( |
int |
optype | ) |
|
|
pure virtual |
Get max message queue size
- Parameters
-
| optype | The operation type: 1 for read, 2 for write |
- Returns
- The max message queue size
| virtual bool esnlib::Session::GetOrderlyHandling |
( |
int |
optype | ) |
|
|
pure virtual |
Check whether the session will process messages sequentially
- Parameters
-
| optype | The operation type: 1 for read, 2 for write |
- Returns
- Whether the session will process messages sequentially
| virtual boost::shared_ptr<IoBuffer> esnlib::Session::GetReadCache |
( |
| ) |
|
|
pure virtual |
Get the read cache
- Returns
- The pointer of the read cache (IO buffer)
| virtual std::string esnlib::Session::GetRemoteIp |
( |
| ) |
|
|
pure virtual |
Get the IP of the remote side
- Returns
- The IP of the remote side
| virtual int esnlib::Session::GetRemotePort |
( |
| ) |
|
|
pure virtual |
Get the port of the remote side
- Returns
- The port of the remote side
| virtual boost::shared_ptr<Session> esnlib::Session::GetSessionById |
( |
int |
id | ) |
|
|
pure virtual |
Get a session by its ID
- Parameters
-
- Returns
- The pointer of the session
| virtual int esnlib::Session::GetSessionCount |
( |
| ) |
|
|
pure virtual |
Get total number of all sessions
- Returns
- Total number of all sessions
| virtual int esnlib::Session::GetSessions |
( |
std::vector< boost::shared_ptr< Session > > & |
sessions | ) |
|
|
pure virtual |
Get all sessions
- Parameters
-
| sessions | The vector used to save all the sessions |
- Returns
- Total number of all sessions
| virtual int esnlib::Session::GetState |
( |
| ) |
|
|
pure virtual |
Get the session's state
- Returns
- The session state
| virtual bool esnlib::Session::HasData |
( |
| ) |
|
|
pure virtual |
Check whether the session has local data
- Returns
- Return true if the session has local data
| virtual bool esnlib::Session::HasGlobalData |
( |
| ) |
|
|
pure virtual |
Check whether the session has global data attached
- Returns
- Return true if the session has global data
| virtual bool esnlib::Session::HasSsl |
( |
| ) |
|
|
pure virtual |
Check whether the session has SSL(Secure Sockets Layer)
- Returns
- Return true if the session has SSL
| virtual void esnlib::Session::ProcessIncomingData |
( |
bool |
asynccall | ) |
|
|
pure virtual |
Process incoming data
- Parameters
-
| asynccall | It is an async call or not |
| virtual void esnlib::Session::ProcessOutgoingData |
( |
bool |
asynccall | ) |
|
|
pure virtual |
Process outgoing data
- Parameters
-
| asynccall | It is an async call or not |
| virtual void esnlib::Session::SetId |
( |
int |
id | ) |
|
|
pure virtual |
Set the session's ID
- Parameters
-
| virtual void esnlib::Session::SetMaxMessageQueueSize |
( |
int |
optype, |
|
|
int |
value |
|
) |
| |
|
pure virtual |
Set max message queue size
- Parameters
-
| optype | The operation type: 1 for read, 2 for write, 0 for both |
| value | The max message queue size |
| virtual void esnlib::Session::SetOrderlyHandling |
( |
int |
optype, |
|
|
bool |
value |
|
) |
| |
|
pure virtual |
Set whether the session will process messages sequentially
- Parameters
-
| optype | The operation type: 1 for read, 2 for write, 0 for both |
| value | Whether the session will process messages sequentially |
| virtual void esnlib::Session::TakeBack |
( |
boost::shared_ptr< IoBuffer > |
buf | ) |
|
|
pure virtual |
Take back the buffer (back to the memory pool)
- Parameters
-
| buf | The pointer of the buffer (IO buffer) |
| virtual void esnlib::Session::TakeBack |
( |
boost::shared_ptr< Buffer > |
buf | ) |
|
|
pure virtual |
Take back the buffer (back to the memory pool)
- Parameters
-
| buf | The pointer of the buffer |
| virtual bool esnlib::Session::TestIdle |
( |
int |
idletype, |
|
|
int |
idletime |
|
) |
| |
|
pure virtual |
Check whether the session is idle (with specific idle type and idle time)
- Parameters
-
| idletype | The idle type: 1 for read idle, 2 for write idle, 0 for both |
| idletime | The idle time (in second) |
- Returns
- Return true if the session is idle
| virtual void esnlib::Session::Write |
( |
boost::shared_ptr< IoBuffer > |
data | ) |
|
|
pure virtual |
Write data
- Parameters
-
| data | The data (a buffer pointer) |
| virtual void esnlib::Session::Write |
( |
const char * |
buf, |
|
|
int |
bufsize |
|
) |
| |
|
pure virtual |
Write buffer
- Parameters
-
| buf | The buffer (a char pointer) |
| bufsize | The size of the buffer |
| virtual void esnlib::Session::Write |
( |
void * |
data | ) |
|
|
pure virtual |
Write data
- Parameters
-
| data | The data (a common pointer) |
| virtual void esnlib::Session::WriteBuffer |
( |
boost::shared_ptr< IoBuffer > |
data | ) |
|
|
pure virtual |
Write buffer
- Parameters
-
| data | The pointer of the buffer |
| virtual void esnlib::Session::WriteData |
( |
void * |
data | ) |
|
|
pure virtual |
Write data
- Parameters
-
| data | The data (a common pointer) |
The documentation for this class was generated from the following file: