ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::serviceio_info Struct Reference

WebSocket服务类前向声明 More...

#include <asio_base.h>

Public Member Functions

 serviceio_info ()=delete
 删除默认构造函数
basio_ioserviceget_ioservice (i32_threadid athreadid)
 解析分配给特定接收线程的io_context/work_guard。
 serviceio_info (i32_threadid athread, int32_t abuffmaxsize)
 创建TCP/WS会话使用的io_context线程池。
void shutdown ()
 停止所有io_context并join所有工作线程。

Public Attributes

std::vector< tuple_ioservicem_ioservices
 每个接收工作线程一个io_context + work_guard + 线程
int32_t m_next_index = 0
 新会话的轮询索引
int32_t m_recvthreadsize = 0
 接收IO线程数
int32_t m_buffmaxsize = 0
 每会话临时缓冲区大小

Detailed Description

WebSocket服务类前向声明

服务IO信息结构体。

管理网络IO服务的线程池和配置信息,包括:

  • 每个接收工作线程的io_context和work_guard
  • 新会话的轮询索引
  • 接收IO线程数
  • 每会话临时缓冲区大小

Constructor & Destructor Documentation

◆ serviceio_info()

ngl::serviceio_info::serviceio_info ( i32_threadid athread,
int32_t abuffmaxsize )

创建TCP/WS会话使用的io_context线程池。

Parameters
athread线程数量
abuffmaxsize每会话临时缓冲区大小

Member Function Documentation

◆ get_ioservice()

basio_ioservice * ngl::serviceio_info::get_ioservice ( i32_threadid athreadid)

解析分配给特定接收线程的io_context/work_guard。

Parameters
athreadid线程ID
Returns
对应的io_context指针

The documentation for this struct was generated from the following files: