IO服务
更多...
#include <eiennet_async.hpp>
|
| | IoService (int threadCount=4, double serverWait=0.002) |
| | 构造函数 更多...
|
| |
| virtual | ~IoService () |
| | 析构函数 更多...
|
| |
| bool | init (int threadCount=4, double serverWait=0.002) |
| | 初始化 更多...
|
| |
| void | stop (bool b=true) |
| | 停止监听服务 更多...
|
| |
| void | postAccept (winux::SharedPointer< AsyncSocket > sock, IoAcceptCtx::OkFunction cbOk, winux::uint64 timeoutMs=-1, IoAcceptCtx::TimeoutFunction cbTimeout=nullptr) |
| |
| void | postConnect (winux::SharedPointer< AsyncSocket > sock, EndPoint const &ep, IoConnectCtx::OkFunction cbOk, winux::uint64 timeoutMs=-1, IoConnectCtx::TimeoutFunction cbTimeout=nullptr) |
| |
| void | postRecv (winux::SharedPointer< AsyncSocket > sock, size_t targetSize, IoRecvCtx::OkFunction cbOk, winux::uint64 timeoutMs=-1, IoRecvCtx::TimeoutFunction cbTimeout=nullptr) |
| |
| void | postSend (winux::SharedPointer< AsyncSocket > sock, void const *data, size_t size, IoSendCtx::OkFunction cbOk, winux::uint64 timeoutMs=-1, IoSendCtx::TimeoutFunction cbTimeout=nullptr) |
| |
| void | postRecvFrom (winux::SharedPointer< AsyncSocket > sock, size_t targetSize, IoRecvFromCtx::OkFunction cbOk, winux::uint64 timeoutMs=-1, IoRecvFromCtx::TimeoutFunction cbTimeout=nullptr) |
| |
| void | postSendTo (winux::SharedPointer< AsyncSocket > sock, EndPoint const &ep, void const *data, size_t size, IoSendToCtx::OkFunction cbOk, winux::uint64 timeoutMs=-1, IoSendToCtx::TimeoutFunction cbTimeout=nullptr) |
| |
| int | run () |
| | 运行 更多...
|
| |
| void | getSockIoCount (size_t *sockCount, size_t *ioCount) const |
| | 获取监听的socks数,IO数 更多...
|
| |
| void | removeSock (winux::SharedPointer< AsyncSocket > sock) |
| | 移除指定sock的所有IO监听 更多...
|
| |
| winux::ThreadPool & | getPool () |
| |
| IoMapMap & | getIoMaps () |
| |
| winux::Mutex & | getMutex () |
| |
| void | onRunBeforeJoinHandler (RunBeforeJoinHandlerFunction handler) |
| |
| void | onRunAfterWaitHandler (RunAfterWaitHandlerFunction handler) |
| |
| eiennet::IoService::IoService |
( |
int |
threadCount = 4, |
|
|
double |
serverWait = 0.002 |
|
) |
| |
构造函数
- 参数
-
| threadCount | int 线程数 |
| serverWait | double 服务器等待时间(ms) |
| virtual eiennet::IoService::~IoService |
( |
| ) |
|
|
virtual |
| bool eiennet::IoService::init |
( |
int |
threadCount = 4, |
|
|
double |
serverWait = 0.002 |
|
) |
| |
| void eiennet::IoService::stop |
( |
bool |
b = true | ) |
|
| int eiennet::IoService::run |
( |
| ) |
|
| void eiennet::IoService::getSockIoCount |
( |
size_t * |
sockCount, |
|
|
size_t * |
ioCount |
|
) |
| const |
| IoMapMap& eiennet::IoService::getIoMaps |
( |
| ) |
|
|
inline |
| virtual void eiennet::IoService::onRunBeforeJoin |
( |
| ) |
|
|
inlineprotectedvirtual |
| virtual void eiennet::IoService::onRunAfterWait |
( |
int |
rc | ) |
|
|
inlineprotectedvirtual |
该类的文档由以下文件生成: