Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tanjunming2020
engine2.0
提交
b62314ae
E
engine2.0
项目概览
tanjunming2020
/
engine2.0
与 Fork 源项目一致
Fork自
xc13262215230 / engine2.0
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine2.0
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b62314ae
编写于
4月 12, 2023
作者:
X
xuchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
在不同系统下选择最佳网络通信模型
上级
85d05359
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
5 deletion
+37
-5
engine2.0/engine2.0/Depends/include/TcpServerMgr.hpp
engine2.0/engine2.0/Depends/include/TcpServerMgr.hpp
+31
-0
engine2.0/engine2.0/HelloHttp/Server.cpp
engine2.0/engine2.0/HelloHttp/Server.cpp
+2
-5
engine2.0/engine2.0/engine1.0/engine1.0.vcxproj
engine2.0/engine2.0/engine1.0/engine1.0.vcxproj
+1
-0
engine2.0/engine2.0/engine1.0/engine1.0.vcxproj.filters
engine2.0/engine2.0/engine1.0/engine1.0.vcxproj.filters
+3
-0
engine2.0/engine2.0/engine2.0.sdf
engine2.0/engine2.0/engine2.0.sdf
+0
-0
engine2.0/engine2.0/engine2.0.v12.suo
engine2.0/engine2.0/engine2.0.v12.suo
+0
-0
未找到文件。
engine2.0/engine2.0/Depends/include/TcpServerMgr.hpp
0 → 100644
浏览文件 @
b62314ae
#
ifndef
_EasyServerMgr_hpp_
#define _EasyServerMgr_hpp_
// 在不同操作系统下面选择最佳网络通信模型
#if _WIN32 // windows系统下面会定义此宏
#include "TcpIocpServer.hpp" // using iocp, only windows.
#elif __linux__ // 在linux系统下面会定义此宏
#include "TcpEpollServer.hpp" // using epoll, only linux.
#else
#include "TcpSelectServer.hpp" // using select, both linux and windows. and other sys.
#endif
namespace
doyou
{
namespace
io
{
#if _WIN32
typedef
TcpIocpServer
TcpServerMgr
;
#elif __linux__
typedef
TcpEpollServer
TcpServerMgr
;
#else
typedef
TcpSelectServer
TcpServerMgr
;
#endif
}
// namespace io
}
// namespace doyou
#endif // _EasyServerMgr_hpp_
engine2.0/engine2.0/HelloHttp/Server.cpp
浏览文件 @
b62314ae
...
...
@@ -2,16 +2,13 @@
#include "Log.hpp"
#include "Config.hpp"
//#include "TcpSelectServer.hpp"
//#include "TcpEpollServer.hpp"
#include "TcpIocpServer.hpp" // 在windows系统下面首选iocp网络模型
#include "TcpServerMgr.hpp"
using
namespace
doyou
::
io
;
// 命名空间
// 可使用服务模型(三选一):1-TcpSelectServer 2-TcpEpollServer 3-TcpIocpServer
class
MyServer
:
public
Tcp
IocpServe
r
class
MyServer
:
public
Tcp
ServerMg
r
{
public:
...
...
engine2.0/engine2.0/engine1.0/engine1.0.vcxproj
浏览文件 @
b62314ae
...
...
@@ -94,6 +94,7 @@
<ClInclude
Include=
"..\Depends\include\TcpSelectClient.hpp"
/>
<ClInclude
Include=
"..\Depends\include\TcpSelectServer.hpp"
/>
<ClInclude
Include=
"..\Depends\include\TcpServer.hpp"
/>
<ClInclude
Include=
"..\Depends\include\TcpServerMgr.hpp"
/>
<ClInclude
Include=
"..\Depends\include\Thread.hpp"
/>
<ClInclude
Include=
"..\Depends\include\TimeStamp.hpp"
/>
</ItemGroup>
...
...
engine2.0/engine2.0/engine1.0/engine1.0.vcxproj.filters
浏览文件 @
b62314ae
...
...
@@ -102,5 +102,8 @@
<ClInclude
Include=
"..\Depends\include\TimeStamp.hpp"
>
<Filter>
源文件
</Filter>
</ClInclude>
<ClInclude
Include=
"..\Depends\include\TcpServerMgr.hpp"
>
<Filter>
源文件
</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
engine2.0/engine2.0/engine2.0.sdf
浏览文件 @
b62314ae
无法预览此类型文件
engine2.0/engine2.0/engine2.0.v12.suo
浏览文件 @
b62314ae
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录