msgid ""
msgstr ""
"Project-Id-Version: Chinese (Simplified Han script) (Boost Beast Translation "
"(zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-07-24 22:43+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Simplified Han script) <https://"
"insights.cppalliance.org/weblate/projects/boost-beast-documentation-zh_Hans/"
"doc-qbk-03-core-4--layers-qbk/zh_Hans/>\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 2026.5\n"

#. type: section title
#: 10
msgid "Layered Streams"
msgstr "分层流类型"

#. type: paragraph
#: 12
msgid ""
"Networking's __ssl_stream__ is a class template meeting the requirements of "
"both synchronous and asynchronous read and write streams, implemented in "
"terms of a \"next layer\" object whose type is determined by a class "
"template parameter. The SSL stream constructs an instance of the next layer "
"object internally, while allowing external access through the observer "
"`net::ssl::stream::next_layer()`. This declares an SSL stream which uses a "
"regular TCP/IP socket as the next layer:"
msgstr ""
"网络库中的 __ssl_stream__ 是一个类模板，它同时满足同步流与异步流的读写要求，"
"其实现基于一个“下一层”对象，该对象的类型由类模板参数决定。SSL 流在内部构造下"
"一层对象的实例，同时通过观察器 `net::ssl::stream::next_layer()` 提供外部访问"
"。以下声明一个 SSL 流，该流使用普通的 TCP/IP 套接字作为其下一层："

#. type: paragraph
#: 22
msgid ""
"Objects using this design pattern are referred to in networking as \"a stack "
"of stream layers\". In Beast we use the term ['layered stream], although the "
"property of having a next layer is not exclusive to streams. As with the SSL "
"stream, __websocket_stream__ is a class template parameterized on a next "
"layer object. This declares a websocket stream which uses a regular TCP/IP "
"socket as the next layer:"
msgstr ""
"采用这种设计模式的对象在网络库中被称为“流层堆栈”。在 Beast 中，我们使用术语 "
"[分层流]，但拥有下一层这一特性并非流所独有。与 SSL 流类似"
"，__websocket_stream__ 也是一个以下一层对象为模板参数的类模板。以下声明一个 "
"WebSocket 流，该流使用普通的 TCP/IP 套接字作为其下一层："

#. type: paragraph
#: 31
msgid ""
"If a Secure WebSockets stream is desired, this is accomplished simply by "
"changing the type of the next layer and adjusting the constructor arguments "
"to match:"
msgstr "如果需要安全 WebSocket 流，只需改变下一层的类型并调整构造参数即可实现："

#. type: paragraph
#: 37
msgid ""
"Higher level abstractions can be developed in this fashion by nesting stream "
"layers to arbitrary degree. The stack of stream layers effectively forms a "
"compile-time singly linked list. The object at the end of this list is "
"called the ['lowest layer], and is special from the others because it "
"typically represents the underlying socket."
msgstr ""
"通过任意层级的嵌套，可以按这种方式构建更高层次的抽象。这些嵌套的流层在编译期"
"形成一个单链表。链表末尾的对象称为 [最底层]，它与其他层有所不同，因为最底层通"
"常代表底层的套接字。"

#. type: paragraph
#: 43
msgid ""
"Beast comes with several layered stream wrappers, as well as facilities for "
"authoring and working with layered streams:"
msgstr "Beast 提供多个分层流包装器，以及用于编写和操作分层流的工具："

#. type: table title
#: 46
msgid "Layered Stream Algorithms and Types"
msgstr "分层流算法与类型"

#. type: table cell
#: 46
msgid "Name"
msgstr "名称"

#. type: table cell
#: 46
msgid "Description"
msgstr "描述"

#. type: table cell
#: 46
msgid ""
"[link beast.ref.boost__beast__basic_stream `basic_stream`] [link "
"beast.ref.boost__beast__tcp_stream `tcp_stream`]"
msgstr ""
"[link beast.ref.boost__beast__basic_stream `basic_stream`] [link "
"beast.ref.boost__beast__tcp_stream `tcp_stream`]"

#. type: table cell
#: 46
msgid ""
"This stream can be used for synchronous and asynchronous reading and "
"writing. It allows timeouts to be set on logical operations, and can have an "
"executor associated with the stream which is used to invoke completion "
"handlers. This lets you set a strand on the stream once, which is then used "
"for all asynchronous operations automatically."
msgstr ""
"该流支持同步和异步读写操作。它允许为逻辑操作设置超时，也可以为流关联一个执行"
"器，用来调用完成处理器。这样就可以对流只设置一次串行器，之后所有异步操作都会"
"自动使用该串行器。"

#. type: table cell
#: 46
msgid ""
"[link beast.ref.boost__beast__buffered_read_stream `buffered_read_stream`]"
msgstr ""
"[link beast.ref.boost__beast__buffered_read_stream `buffered_read_stream`]"

#. type: table cell
#: 46
msgid ""
"A buffered read stream meets the requirements for synchronous and "
"asynchronous read and write streams, and additionally implements "
"configurable buffering for reads."
msgstr "带缓冲的读流用于满足同步和异步读写流的要求，并额外实现可配置的读缓冲功能。"

#. type: table cell
#: 46
msgid "[link beast.ref.boost__beast__close_socket `close_socket`]"
msgstr "[link beast.ref.boost__beast__close_socket `close_socket`]"

#. type: table cell
#: 46
msgid ""
"This function closes a socket by performing an unqualified call to the [link "
"beast.ref.boost__beast__beast_close_socket `beast_close_socket`] "
"customization point, allowing sockets to be closed in generic contexts in an "
"extensible fashion."
msgstr ""
"该函数通过无限定调用 [link beast.ref.boost__beast__beast_close_socket "
"`beast_close_socket`] 这个定制点来关闭套接字，从而在泛型上下文中以一种可扩展"
"的方式完成套接字关闭。"

#. type: table cell
#: 46
msgid "[link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`]"
msgstr "[link beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`]"

#. type: table cell
#: 46
msgid ""
"Returns the lowest layer in a stack of stream layers by recursively calling "
"the `next_layer` member function on each object until reaching an object "
"which lacks the member. This example puts a layered stream into non-blocking "
"mode by retrieving the TCP/IP socket in the lowest layer and changing the "
"socket option:\n"
"\n"
"[code_core_4_layers_4]"
msgstr ""
"通过递归调用每个对象的 `next_layer` 成员函数，直到遇到没有该成员的对象，从而"
"返回流层堆栈中的最底层。以下示例通过获取最底层的 TCP/IP 套接字并修改其套接字"
"选项，将分层流设置为非阻塞模式：\n"
"\n"
"[code_core_4_layers_4]"

#. type: table cell
#: 46
msgid "[link beast.ref.boost__beast__http__icy_stream `http::icy_stream`]"
msgstr "[link beast.ref.boost__beast__http__icy_stream `http::icy_stream`]"

#. type: table cell
#: 46
msgid ""
"An ICY stream transparently converts the non-standard \"ICY 200 OK\" HTTP "
"response from Shoutcast servers into a conforming 200 level HTTP response."
msgstr ""
"ICY 流用于将 Shoutcast 服务器返回的非标准 “ICY 200 OK” HTTP 响应透明转换为符"
"合规范的 200 级别 HTTP 响应。"

#. type: table cell
#: 46
msgid "[link beast.ref.boost__beast__lowest_layer_type `lowest_layer_type`]"
msgstr "[link beast.ref.boost__beast__lowest_layer_type `lowest_layer_type`]"

#. type: table cell
#: 46
msgid ""
"A metafunction to return the type of the lowest layer used in a type "
"representing a stack of stream layers. This is the type of reference "
"returned by [link beast.ref.boost__beast__get_lowest_layer "
"`get_lowest_layer`]"
msgstr ""
"一个元函数，用于返回表示流层堆栈的类型中所使用的最底层的类型。该类型与 [link "
"beast.ref.boost__beast__get_lowest_layer `get_lowest_layer`] 返回的引用类型一"
"致。"

#. type: section title
#: 105
msgid "Counted Stream __example__"
msgstr "计数流 __示例__"

#. type: paragraph
#: 107
msgid ""
"This example shows the definition of a layered stream which keeps individual "
"counts of the total number of bytes read from and written to the next layer. "
"It meets the requirements for synchronous and asynchronous read and write "
"streams:"
msgstr ""
"以下示例定义一个分层流，该流分别统计从下一层读取和写入的总字节数。该分层流满"
"足同步与异步读写流的要求："
