Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
ascs
提交
65088fb5
A
ascs
项目概览
youngwolf
/
ascs
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ascs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
65088fb5
编写于
11月 10, 2021
作者:
Y
youngwolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support customizing the distribution of multipal io_contexts.
上级
d5e4b35e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
6 deletion
+6
-6
asio
asio
+1
-1
examples/udp_test/udp_test.cpp
examples/udp_test/udp_test.cpp
+1
-1
include/ascs/service_pump.h
include/ascs/service_pump.h
+4
-4
未找到文件。
asio
@
08a7029c
比较
d038fb3c
...
08a7029c
Subproject commit
d038fb3c2fb56fb91ff1d17b0715cff7887aa09e
Subproject commit
08a7029cb10c911b6fb66fb015217a431206e52c
examples/udp_test/udp_test.cpp
浏览文件 @
65088fb5
...
...
@@ -40,7 +40,7 @@ template <typename Socket> std::thread create_sync_recv_thread(Socket& socket)
});
}
//because
st_asio_wrapper
is header only, it cannot provide the implementation of below global function, but kcp needs it,
//because
ascs
is header only, it cannot provide the implementation of below global function, but kcp needs it,
//you're supposed to provide it and call reliable_socket_base::output directly in it, like:
int
output
(
const
char
*
buf
,
int
len
,
ikcpcb
*
kcp
,
void
*
user
)
{
return
((
single_reliable_socket_service
*
)
user
)
->
output
(
buf
,
len
);}
...
...
include/ascs/service_pump.h
浏览文件 @
65088fb5
...
...
@@ -164,15 +164,15 @@ public:
throw
"no available io_context!"
;
}
void
return_io_context
(
const
asio
::
execution_context
&
io_context
)
void
return_io_context
(
const
asio
::
execution_context
&
io_context
,
unsigned
refs
=
1
)
{
if
(
!
single_io_context
)
ascs
::
do_something_to_one
(
context_can
,
context_can_mutex
,
[
&
](
context
&
item
)
{
return
&
io_context
!=
&
item
.
io_context
?
false
:
(
--
item
.
refs
,
true
);});
ascs
::
do_something_to_one
(
context_can
,
context_can_mutex
,
[
&
](
context
&
item
)
{
return
&
io_context
!=
&
item
.
io_context
?
false
:
(
item
.
refs
-=
refs
,
true
);});
}
void
assign_io_context
(
const
asio
::
execution_context
&
io_context
)
void
assign_io_context
(
const
asio
::
execution_context
&
io_context
,
unsigned
refs
=
1
)
{
if
(
!
single_io_context
)
ascs
::
do_something_to_one
(
context_can
,
context_can_mutex
,
[
&
](
context
&
item
)
{
return
&
io_context
!=
&
item
.
io_context
?
false
:
(
++
item
.
refs
,
true
);});
ascs
::
do_something_to_one
(
context_can
,
context_can_mutex
,
[
&
](
context
&
item
)
{
return
&
io_context
!=
&
item
.
io_context
?
false
:
(
item
.
refs
+=
refs
,
true
);});
}
object_type
find
(
int
id
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录