gpt4 book ai didi

c++ - 我不明白为什么 boost::asio::read_until 读取定界符后面的字符

转载 作者:行者123 更新时间:2023-11-28 05:03:24 33 4
gpt4 key购买 nike

根据 boost::asio::read_until 文档:

After a successful read_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read_until operation to examine.

我不明白为什么会这样。

是不是因为在 TCP 协议(protocol)中,如果不读取所有可用字符,就会丢失它们?

最佳答案

因为如果它只读到你想要的字符,它就必须一次读取一个字符。这将是非常低效的。

关于c++ - 我不明白为什么 boost::asio::read_until 读取定界符后面的字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45376498/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com