Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
The__DynamicBuffer__concept defines a resizable buffer sequence interface. Algorithms may be expressed in terms of dynamic buffers when the memory requirements are not known ahead of time, for example when reading an HTTP message from a stream. Beast provides a well-rounded collection of dynamic buffer types such as概念用于定义一个可调整大小的缓冲区序列接口。当内存需求无法预先确定时(例如从流中读取 HTTP 消息时),算法可以使用动态缓冲区来表达。Beast 提供一系列完善的动态缓冲区类型,包括 [link beast.ref.boost__beast__buffers_adaptor `buffers_adaptor`],、[link beast.ref.boost__beast__flat_buffer `flat_buffer`],、[link beast.ref.boost__beast__multi_buffer `multi_buffer`], and以及 [link beast.ref.boost__beast__static_buffer `static_buffer`]. The following function reads data from a。以下函数从 [link beast.ref.boost__beast__tcp_stream `tcp_stream`]into a dynamic buffer until it encountering a newline character, using中读取数据到动态缓冲区,直到遇到换行符为止,该函数使用 [@boost:/doc/html/boost_asio/reference/buffers_iterator.html `net::buffers_iterator`]to treat the contents of the buffer as a range of characters:将缓冲区内容视为字符范围进行处理: