Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
st_asio_wrapper
提交
730858f9
S
st_asio_wrapper
项目概览
youngwolf
/
st_asio_wrapper
通知
10
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
st_asio_wrapper
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
730858f9
编写于
11月 22, 2016
作者:
Y
youngwolf
提交者:
youngowlf
4月 27, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Continue last commit.
上级
e281531a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
17 deletion
+13
-17
compatible_edition/include/st_asio_wrapper.h
compatible_edition/include/st_asio_wrapper.h
+1
-1
compatible_edition/include/st_asio_wrapper_base.h
compatible_edition/include/st_asio_wrapper_base.h
+3
-3
file_server/file_server.cpp
file_server/file_server.cpp
+1
-5
file_server/file_socket.cpp
file_server/file_socket.cpp
+1
-5
include/st_asio_wrapper_base.h
include/st_asio_wrapper_base.h
+7
-3
未找到文件。
compatible_edition/include/st_asio_wrapper.h
浏览文件 @
730858f9
...
...
@@ -24,7 +24,7 @@
#ifdef _MSC_VER
#if _MSC_VER >= 1600
#
warning Your compiler is Visual C++ 10.0 or higher, you can use the standard edition to gain some performance improvement.
#
pragma message("Your compiler is Visual C++ 10.0 or higher, you can use the standard edition to gain some performance improvement.")
#endif
#elif defined(__GNUC__)
//After a roughly reading from gcc.gnu.org and clang.llvm.org, I believed that the minimum version of GCC and Clang that support c++0x
...
...
compatible_edition/include/st_asio_wrapper_base.h
浏览文件 @
730858f9
...
...
@@ -157,9 +157,6 @@ public:
protected:
buffer_type
buffer
;
};
typedef
auto_buffer
<
i_buffer
>
replaceable_buffer
;
//replaceable_packer and replaceable_unpacker used replaceable_buffer as their msg type, so they're replaceable,
//shared_buffer<i_buffer> is available too.
//convert '->' operation to '.' operation
//user need to allocate object, and shared_buffer will free it
...
...
@@ -193,6 +190,9 @@ protected:
};
//not like auto_buffer, shared_buffer is copyable, but auto_buffer is a bit more efficient.
typedef
auto_buffer
<
i_buffer
>
replaceable_buffer
;
//packer or/and unpacker used replaceable_buffer (or shared_buffer) as their msg type will be replaceable.
//packer concept
template
<
typename
MsgType
>
class
i_packer
...
...
file_server/file_server.cpp
浏览文件 @
730858f9
...
...
@@ -12,11 +12,7 @@
//but file_server only receive talking message, not send talking message proactively), the previous message has been
//sent to file_client, so sending buffer will always be empty, which means we will never operate sending buffer concurrently,
//so need no locks.
#if !defined(_MSC_VER) || _MSC_VER > 1800
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<> //before C++ 14.0, auto_buffer will lead compilation error, who can tell me why?
#else
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<shared_buffer<i_buffer>>
#endif
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<>
//configuration
#include "../include/st_asio_wrapper_server.h"
...
...
file_server/file_socket.cpp
浏览文件 @
730858f9
...
...
@@ -10,11 +10,7 @@
//but file_server only receive talking message, not send talking message proactively), the previous message has been
//sent to file_client, so sending buffer will always be empty, which means we will never operate sending buffer concurrently,
//so need no locks.
#if !defined(_MSC_VER) || _MSC_VER > 1800
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<> //before C++ 14.0, auto_buffer will lead compilation error, who can tell me why?
#else
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<shared_buffer<i_buffer>>
#endif
#define ST_ASIO_DEFAULT_PACKER replaceable_packer<>
//configuration
#include "file_socket.h"
...
...
include/st_asio_wrapper_base.h
浏览文件 @
730858f9
...
...
@@ -154,9 +154,6 @@ public:
protected:
buffer_type
buffer
;
};
typedef
auto_buffer
<
i_buffer
>
replaceable_buffer
;
//replaceable_packer and replaceable_unpacker used replaceable_buffer as their msg type, so they're replaceable,
//shared_buffer<i_buffer> is available too.
//convert '->' operation to '.' operation
//user need to allocate object, and shared_buffer will free it
...
...
@@ -193,6 +190,13 @@ protected:
};
//not like auto_buffer, shared_buffer is copyable, but auto_buffer is a bit more efficient.
#if !defined(_MSC_VER) || _MSC_VER > 1800
typedef
auto_buffer
<
i_buffer
>
replaceable_buffer
;
#else
typedef
shared_buffer
<
i_buffer
>
replaceable_buffer
;
//before C++ 14.0, auto_buffer will lead compilation error, who can tell me why?
#endif
//packer or/and unpacker used replaceable_buffer as their msg type will be replaceable.
//packer concept
template
<
typename
MsgType
>
class
i_packer
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录