载入中...
搜索中...
未找到
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 ()
 Net worker.
 
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.h 第 22 行定义.

构造及析构函数说明

◆ NetWorker()

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

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

在文件 NetWorker.cpp 第 8 行定义.

◆ ~NetWorker()

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

Net worker.

在文件 NetWorker.cpp 第 10 行定义.

引用了 stop().

成员函数说明

◆ drain()

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

Test helper: moves all pending completions into out.

在文件 NetWorker.cpp 第 33 行定义.

◆ post()

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

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

在文件 NetWorker.cpp 第 28 行定义.

引用了 c.

◆ start()

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

Starts the worker thread.

在文件 NetWorker.cpp 第 14 行定义.

◆ stop()

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

Stops the worker thread and joins it.

在文件 NetWorker.cpp 第 20 行定义.

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

◆ submit()

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

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

在文件 NetWorker.cpp 第 38 行定义.

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


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