Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
ascs
提交
9bda2c75
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,发现更多精彩内容 >>
提交
9bda2c75
编写于
12月 22, 2019
作者:
Y
youngwolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Continue last commit.
上级
fbf80699
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
3 deletion
+6
-3
examples/echo_server/echo_server.cpp
examples/echo_server/echo_server.cpp
+5
-3
include/ascs/config.h
include/ascs/config.h
+1
-0
未找到文件。
examples/echo_server/echo_server.cpp
浏览文件 @
9bda2c75
...
...
@@ -296,7 +296,7 @@ int main(int argc, const char* argv[])
{
// /*
//broadcast series functions call pack_msg for each client respectively, because clients may used different protocols(so different type of packers, of course)
normal_server_
.
broadcast_msg
(
str
.
data
(),
str
.
size
()
+
1
,
false
);
normal_server_
.
broadcast_msg
(
str
.
data
(),
str
.
size
()
+
1
);
//send \0 character too, because demo client used basic_buffer as its msg type, it will not append \0 character automatically as std::string does,
//so need \0 character when printing it.
// */
...
...
@@ -307,11 +307,13 @@ int main(int argc, const char* argv[])
//send \0 character too, because demo client used basic_buffer as its msg type, it will not append \0 character automatically as std::string does,
//so need \0 character when printing it.
if (!msg.empty())
normal_server_
.do_something_to_all([&msg](server_base<normal_socket>::object_ctype& item) {item->direct_send_msg(msg);});
((normal_server&) normal_server_)
.do_something_to_all([&msg](server_base<normal_socket>::object_ctype& item) {item->direct_send_msg(msg);});
*/
/*
//if demo client is using stream_unpacker
normal_server_.do_something_to_all([&str](server_base<normal_socket>::object_ctype& item) {item->direct_send_msg(str);});
((normal_server&) normal_server_).do_something_to_all([&str](server_base<normal_socket>::object_ctype& item) {item->direct_send_msg(str);});
//or
normal_server_.broadcast_native_msg(str);
*/
}
}
...
...
include/ascs/config.h
浏览文件 @
9bda2c75
...
...
@@ -607,6 +607,7 @@
* 2020.x.x version 1.5.0
*
* SPECIAL ATTENTION (incompatible with old editions):
* Add a new parameter prior to send_msg (series) function (after can_overflow).
* Delete macro ASCS_ENHANCED_STABILITY, which means now we always have it, if you really don't want it, define macro ASCS_NO_TRY_CATCH.
* Change macro ASCS_LLF from %lu or %llu to %ld or %lld, this can shorten the output during printing invalid ids ((uint_fast64_t) -1).
* Apply the same reconnecting mechanism for message unpacking error (before, we always disabled reconnecting mechanism).
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录