Ai
1 Star 0 Fork 0

周不才/cpp_linux study

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
TcpServer.cc 494 Bytes
一键复制 编辑 原始数据 按行查看 历史
周不才 提交于 2025-03-13 14:38 +08:00 . RemoteCommandExecution
#include "TcpServer.hpp"
#include <memory>
//使用 ./tcpserver+端口号 启动服务端
int main(int argc,char* argv[])
{
if(argc!=2)
{
std::cerr<<"Usage: "<<argv[0]<<" local-port"<<std::endl;
exit(0);
}
uint16_t port=std::stoi(argv[1]);//保存端口号
std::unique_ptr<TcpServer> tsvr=std::make_unique<TcpServer>(port);//创建一个指向TcpServer类对象的智能指针
tsvr->InitServer();//初始化服务器
tsvr->Loop();//启动服务器
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yan0605/cpp_linux-study.git
git@gitee.com:yan0605/cpp_linux-study.git
yan0605
cpp_linux-study
cpp_linux study
master

搜索帮助