@@ -206,9 +206,10 @@ int main(int argc, const char* argv[])
//if all clients used the same protocol, we can pack msg one time, and send it repeatedly like this:
packerp;
automsg=p.pack_msg(str.data(),str.size()+1);
// auto msg = p.pack_msg(str.data(), str.size() + 1);
//send \0 character too, because asio_client used inflexible_buffer as its msg type, it will not append \0 character automatically as std::string does,
//so need \0 character when printing it.
automsg=p.pack_msg(str,true);//if asio_client is using stream_unpacker
@@ -213,7 +213,8 @@ int main(int argc, const char* argv[])
packer::msg_typemsg;
//send \0 character too, because asio_client used inflexible_buffer as its msg type, it will not append \0 character automatically as std::string does,
//so need \0 character when printing it.
if(p.pack_msg(msg,str.data(),str.size()+1))
// if (p.pack_msg(msg, str.data(), str.size() + 1))
if(p.pack_msg(msg,str,true))//if asio_client is using stream_unpacker