IO Handler class (interface) More...
#include <IoHandler.h>
Public Member Functions | |
virtual int | OnRead (SessionPtr session, IoBufferPtr data)=0 |
virtual int | OnWrite (SessionPtr session, IoBufferPtr data)=0 |
virtual void | OnConnect (SessionPtr session)=0 |
virtual void | OnDisconnect (SessionPtr session)=0 |
virtual void | OnIdle (SessionPtr session, int idleType)=0 |
virtual void | OnError (SessionPtr session, int errorType, int errorCode, const std::string &errorMsg)=0 |
IO Handler class (interface)
|
pure virtual |
The callback function for the Connect event
session | Current session |
Implemented in esnlib::MessageHandler, and esnlib::StringHandler.
|
pure virtual |
The callback function for the Disconnect event
session | Current session |
Implemented in esnlib::MessageHandler, and esnlib::StringHandler.
|
pure virtual |
The callback function for the Error event
session | Current session |
errorType | The error type (1 for read error, 2 for write error, 0 for connect error) |
errorCode | The error code (if error type == 0 and error code == 0, that means connect timeout) |
errorMsg | The error message |
Implemented in esnlib::MessageHandler, and esnlib::StringHandler.
|
pure virtual |
The callback function for the Idle event
session | Current session |
idleType | The idle type (1 for read idle, 2 for write idle, 0 for both) |
Implemented in esnlib::MessageHandler, and esnlib::StringHandler.
|
pure virtual |
The callback function for the Read event
session | Current session |
data | The buffer pointer of the useful data read |
Implemented in esnlib::MessageHandler, and esnlib::StringHandler.
|
pure virtual |
The callback function for the Write event
session | Current session |
data | The buffer pointer of the data written |
Implemented in esnlib::MessageHandler, and esnlib::StringHandler.