载入中...
搜索中...
未找到
eve::network::NetWorker类 参考

Background thread that runs blocking socket I/O and HTTP jobs. Completions are queued and drained by Network::pump on the main thread. 更多...

#include <NetWorker.h>

Public 成员函数

 NetWorker (Network *owner)
 Creates a worker owned by owner (not started yet).
 
 ~NetWorker ()
 
void start ()
 Starts the worker thread.
 
void stop ()
 Stops the worker thread and joins it.
 
void post (NetCompletion c)
 Queues a completion for the main thread (thread-safe).
 
void drain (std::vector< NetCompletion > &out)
 Test helper: moves all pending completions into out.
 
void submit (std::function< void()> job)
 Queues an arbitrary blocking job to run on the worker thread.
 

详细描述

Background thread that runs blocking socket I/O and HTTP jobs. Completions are queued and drained by Network::pump on the main thread.

在文件 NetWorker.h20 行定义.

构造及析构函数说明

◆ NetWorker()

eve::network::NetWorker::NetWorker ( Network owner)
explicit

Creates a worker owned by owner (not started yet).

在文件 NetWorker.cpp8 行定义.

◆ ~NetWorker()

eve::network::NetWorker::~NetWorker ( )

在文件 NetWorker.cpp10 行定义.

引用了 stop().

成员函数说明

◆ drain()

void eve::network::NetWorker::drain ( std::vector< NetCompletion > &  out)

Test helper: moves all pending completions into out.

在文件 NetWorker.cpp35 行定义.

◆ post()

void eve::network::NetWorker::post ( NetCompletion  c)

Queues a completion for the main thread (thread-safe).

在文件 NetWorker.cpp30 行定义.

引用了 c.

◆ start()

void eve::network::NetWorker::start ( )

Starts the worker thread.

在文件 NetWorker.cpp14 行定义.

◆ stop()

void eve::network::NetWorker::stop ( )

Stops the worker thread and joins it.

在文件 NetWorker.cpp20 行定义.

被这些函数引用 ~NetWorker().

◆ submit()

void eve::network::NetWorker::submit ( std::function< void()>  job)

Queues an arbitrary blocking job to run on the worker thread.

在文件 NetWorker.cpp40 行定义.

被这些函数引用 eve::network::TcpSocket::connect(), eve::network::UdpSocket::send() , 以及 eve::network::UdpSocket::sendTo().


该类的文档由以下文件生成: