diff --git a/examples/echo_server/echo_server.cpp b/examples/echo_server/echo_server.cpp index 39bc47e71bba436c55ab354c371b5cf51660d321..7d90a4017a0bba97bbb875feb2de4249ca2e65a7 100644 --- a/examples/echo_server/echo_server.cpp +++ b/examples/echo_server/echo_server.cpp @@ -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::object_ctype& item) {item->direct_send_msg(msg);}); + ((normal_server&) normal_server_).do_something_to_all([&msg](server_base::object_ctype& item) {item->direct_send_msg(msg);}); */ /* //if demo client is using stream_unpacker - normal_server_.do_something_to_all([&str](server_base::object_ctype& item) {item->direct_send_msg(str);}); + ((normal_server&) normal_server_).do_something_to_all([&str](server_base::object_ctype& item) {item->direct_send_msg(str);}); + //or + normal_server_.broadcast_native_msg(str); */ } } diff --git a/include/ascs/config.h b/include/ascs/config.h index 49dca4a649aa47f2027078478853ad25b181e446..066b93358e9d75420014bb5aa84d875817247c47 100644 --- a/include/ascs/config.h +++ b/include/ascs/config.h @@ -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).