LogSystem beta 1.4
This is a logging system project
 
载入中...
搜索中...
未找到
XuServer::TcpServer类 参考

TCP服务器 更多...

#include <server.hpp>

类 XuServer::TcpServer 继承关系图:
XuServer::TcpServer 的协作图:

Public 成员函数

 TcpServer (uint16_t port, CallBack call_back, int thread_count=5)
 构造函数
 
void Loop ()
 启动监听
 
- Public 成员函数 继承自 XuServer::nocopy
 nocopy ()
 
 nocopy (const nocopy &)=delete
 
const nocopyoperator= (const nocopy &)=delete
 
 ~nocopy ()
 

静态 Public 成员函数

static void * ThreadRun (void *args)
 启动线程
 

Public 属性

CallBack _call_back
 回调函数
 

Private 属性

int _port
 端口号
 
TcpSocket_listen_socket
 监听socket
 
std::unique_ptr< threadpool_thread_pool
 线程池
 

详细描述

TCP服务器

构造及析构函数说明

◆ TcpServer()

XuServer::TcpServer::TcpServer ( uint16_t  port,
CallBack  call_back,
int  thread_count = 5 
)
inline

构造函数

参数
port监听端口号
call_back处理获取数据的回调函数
thread_count线程数量
函数调用图:

成员函数说明

◆ Loop()

void XuServer::TcpServer::Loop ( )
inline

启动监听

函数调用图:

◆ ThreadRun()

static void * XuServer::TcpServer::ThreadRun ( void *  args)
inlinestatic

启动线程

函数调用图:
这是这个函数的调用关系图:

类成员变量说明

◆ _call_back

CallBack XuServer::TcpServer::_call_back

回调函数

◆ _listen_socket

TcpSocket* XuServer::TcpServer::_listen_socket
private

监听socket

◆ _port

int XuServer::TcpServer::_port
private

端口号

◆ _thread_pool

std::unique_ptr<threadpool> XuServer::TcpServer::_thread_pool
private

线程池