提交 9bda2c75 编写于 作者: Y youngwolf

Continue last commit.

上级 fbf80699
......@@ -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);
*/
}
}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册