Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
ascs
提交
94631594
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,发现更多精彩内容 >>
提交
94631594
编写于
2月 15, 2021
作者:
Y
youngwolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typos in annotations.
上级
3d18008c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
13 addition
and
13 deletion
+13
-13
examples/echo_client/echo_client.cpp
examples/echo_client/echo_client.cpp
+2
-2
examples/echo_server/echo_server.cpp
examples/echo_server/echo_server.cpp
+5
-5
examples/file_server/file_socket.h
examples/file_server/file_socket.h
+1
-1
examples/pingpong_client/pingpong_client.cpp
examples/pingpong_client/pingpong_client.cpp
+1
-1
examples/pingpong_server/pingpong_server.cpp
examples/pingpong_server/pingpong_server.cpp
+1
-1
include/ascs/object_pool.h
include/ascs/object_pool.h
+1
-1
include/ascs/tcp/socket.h
include/ascs/tcp/socket.h
+1
-1
include/ascs/udp/socket.h
include/ascs/udp/socket.h
+1
-1
未找到文件。
examples/echo_client/echo_client.cpp
浏览文件 @
94631594
...
...
@@ -113,7 +113,7 @@ public:
protected:
//msg handling
#ifdef ASCS_SYNC_DISPATCH
//do not hold msg_can for further us
ing
, return from on_msg as quickly as possible
//do not hold msg_can for further us
age
, return from on_msg as quickly as possible
//access msg_can freely within this callback, it's always thread safe.
virtual
size_t
on_msg
(
std
::
list
<
out_msg_type
>&
msg_can
)
{
...
...
@@ -129,7 +129,7 @@ protected:
}
#endif
#ifdef ASCS_DISPATCH_BATCH_MSG
//do not hold msg_can for further us
ing
, access msg_can and return from on_msg_handle as quickly as possible
//do not hold msg_can for further us
age
, access msg_can and return from on_msg_handle as quickly as possible
//can only access msg_can via functions that marked as 'thread safe', if you used non-lock queue, its your responsibility to guarantee
// that new messages will not come until we returned from this callback (for example, pingpong test).
virtual
size_t
on_msg_handle
(
out_queue_type
&
msg_can
)
...
...
examples/echo_server/echo_server.cpp
浏览文件 @
94631594
...
...
@@ -92,7 +92,7 @@ public:
public:
//because we use objects pool(REUSE_OBJECT been defined), so, strictly speaking, this virtual
//function must be rewrote, but we don't have member variables to initialize but invoke father's
//reset() directly, so, it can be omitted, but we keep it for
possibly future using
//reset() directly, so, it can be omitted, but we keep it for
the possibility of using it in the future
virtual
void
reset
()
{
super
::
reset
();}
protected:
...
...
@@ -106,7 +106,7 @@ protected:
//msg handling: send the original msg back(echo server)
#ifdef ASCS_SYNC_DISPATCH //do not open this feature
//do not hold msg_can for further us
ing
, return from on_msg as quickly as possible
//do not hold msg_can for further us
age
, return from on_msg as quickly as possible
//access msg_can freely within this callback, it's always thread safe.
virtual
size_t
on_msg
(
std
::
list
<
out_msg_type
>&
msg_can
)
{
...
...
@@ -129,7 +129,7 @@ protected:
#endif
#ifdef ASCS_DISPATCH_BATCH_MSG
//do not hold msg_can for further us
ing
, access msg_can and return from on_msg_handle as quickly as possible
//do not hold msg_can for further us
age
, access msg_can and return from on_msg_handle as quickly as possible
//can only access msg_can via functions that marked as 'thread safe', if you used non-lock queue, its your responsibility to guarantee
// that new messages will not come until we returned from this callback (for example, pingpong test).
virtual
size_t
on_msg_handle
(
out_queue_type
&
msg_can
)
...
...
@@ -202,13 +202,13 @@ public:
protected:
//msg handling
#ifdef ASCS_SYNC_DISPATCH
//do not hold msg_can for further us
ing
, return from on_msg as quickly as possible
//do not hold msg_can for further us
age
, return from on_msg as quickly as possible
//access msg_can freely within this callback, it's always thread safe.
virtual
size_t
on_msg
(
std
::
list
<
out_msg_type
>&
msg_can
)
{
auto
re
=
super
::
on_msg
(
msg_can
);
force_shutdown
();
return
re
;}
#endif
#ifdef ASCS_DISPATCH_BATCH_MSG
//do not hold msg_can for further us
ing
, access msg_can and return from on_msg_handle as quickly as possible
//do not hold msg_can for further us
age
, access msg_can and return from on_msg_handle as quickly as possible
//can only access msg_can via functions that marked as 'thread safe', if you used non-lock queue, its your responsibility to guarantee
// that new messages will not come until we returned from this callback (for example, pingpong test).
virtual
size_t
on_msg_handle
(
out_queue_type
&
msg_can
)
{
auto
re
=
super
::
on_msg_handle
(
msg_can
);
force_shutdown
();
return
re
;}
...
...
examples/file_server/file_socket.h
浏览文件 @
94631594
...
...
@@ -16,7 +16,7 @@ public:
public:
//because we don't use objects pool(we don't defined ASCS_REUSE_OBJECT), so this virtual function will
//not be invoked, and can be omitted, but we keep it for
possibly future using
//not be invoked, and can be omitted, but we keep it for
the possibility of using it in the future
virtual
void
reset
();
virtual
void
take_over
(
std
::
shared_ptr
<
file_socket
>
socket_ptr
);
...
...
examples/pingpong_client/pingpong_client.cpp
浏览文件 @
94631594
...
...
@@ -50,7 +50,7 @@ protected:
virtual
void
on_connect
()
{
asio
::
ip
::
tcp
::
no_delay
option
(
true
);
lowest_layer
().
set_option
(
option
);
client_socket
::
on_connect
();}
//msg handling, must define macro ASCS_SYNC_DISPATCH
//do not hold msg_can for further us
ing
, access msg_can and return from on_msg as quickly as possible
//do not hold msg_can for further us
age
, access msg_can and return from on_msg as quickly as possible
//access msg_can freely within this callback, it's always thread safe.
virtual
size_t
on_msg
(
std
::
list
<
out_msg_type
>&
msg_can
)
{
...
...
examples/pingpong_server/pingpong_server.cpp
浏览文件 @
94631594
...
...
@@ -30,7 +30,7 @@ public:
protected:
//msg handling: send the original msg back (echo server), must define macro ASCS_SYNC_DISPATCH
//do not hold msg_can for further us
ing
, access msg_can and return from on_msg as quickly as possible
//do not hold msg_can for further us
age
, access msg_can and return from on_msg as quickly as possible
//access msg_can freely within this callback, it's always thread safe.
virtual
size_t
on_msg
(
std
::
list
<
out_msg_type
>&
msg_can
)
{
...
...
include/ascs/object_pool.h
浏览文件 @
94631594
...
...
@@ -328,7 +328,7 @@ public:
// //in this function without unique() checking.
// socket_ptr->set_timer(...);
//}
//then in the future, when invok
ing the timer handler, the socket has been freed and it'
s this pointer already became wild.
//then in the future, when invok
e the timer handler, the socket has been freed and it
s this pointer already became wild.
if
((
*
iter
).
unique
()
&&
(
*
iter
)
->
obsoleted
())
{
--
num
;
...
...
include/ascs/tcp/socket.h
浏览文件 @
94631594
...
...
@@ -224,7 +224,7 @@ protected:
//generally, you don't have to rewrite this to maintain the status of connections
//msg_can contains messages that were failed to send and tcp::socket_base will not hold them any more, if you want to re-send them in the future,
// you must take over them and re-send (at any time) them via direct_send_msg.
//DO NOT hold msg_can for fu
ture using
, just swap its content with your own container in this virtual function.
//DO NOT hold msg_can for fu
rther usage
, just swap its content with your own container in this virtual function.
virtual
void
on_send_error
(
const
asio
::
error_code
&
ec
,
typename
super
::
in_container_type
&
msg_can
)
{
unified_out
::
error_out
(
ASCS_LLF
" send msg error (%d %s)"
,
this
->
id
(),
ec
.
value
(),
ec
.
message
().
data
());}
...
...
include/ascs/udp/socket.h
浏览文件 @
94631594
...
...
@@ -199,7 +199,7 @@ protected:
//msg was failed to send and udp::generic_socket will not hold it any more, if you want to re-send it in the future,
// you must take over it and re-send (at any time) it via direct_send_msg.
//DO NOT hold msg for fu
ture using
, just swap its content with your own message in this virtual function.
//DO NOT hold msg for fu
rther usage
, just swap its content with your own message in this virtual function.
virtual
void
on_send_error
(
const
asio
::
error_code
&
ec
,
typename
super
::
in_msg
&
msg
)
{
unified_out
::
error_out
(
ASCS_LLF
" send msg error (%d %s)"
,
this
->
id
(),
ec
.
value
(),
ec
.
message
().
data
());}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录