boost::asio async_read guarantee all bytes are read

前端 未结 3 1845
悲&欢浪女
悲&欢浪女 2020-12-06 12:59

I have a server that receives a compressed string (compressed with zlib) from a client, and I was using async_receive from the boost::asio library

3条回答
  •  误落风尘
    2020-12-06 13:43

    Use async_read_until and create your own match condition, or change your protocol to send a header including the number of bytes to expect in the compressed string.

提交回复
热议问题