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

#. type: section title
#: 10
#, read-only
msgid "WebSocket"
msgstr "WebSocket"

#. type: paragraph
#: 14
#, read-only
msgid ""
"The WebSocket Protocol enables two-way communication between a client "
"running untrusted code in a controlled environment to a remote host that has "
"opted-in to communications from that code. The protocol consists of an "
"opening handshake followed by basic message framing, layered over TCP.  The "
"goal of this technology is to provide a mechanism for browser-based "
"applications needing two-way communication with servers without relying on "
"opening multiple HTTP connections."
msgstr ""
"The WebSocket Protocol enables two-way communication between a client "
"running untrusted code in a controlled environment to a remote host that has "
"opted-in to communications from that code. The protocol consists of an "
"opening handshake followed by basic message framing, layered over TCP.  The "
"goal of this technology is to provide a mechanism for browser-based "
"applications needing two-way communication with servers without relying on "
"opening multiple HTTP connections."

#. type: paragraph
#: 22
#, read-only
msgid ""
"Beast provides developers with a robust WebSocket implementation built on "
"Boost.Asio with a consistent asynchronous model using a modern C++ approach."
msgstr ""
"Beast provides developers with a robust WebSocket implementation built on "
"Boost.Asio with a consistent asynchronous model using a modern C++ approach."

#. type: paragraph
#: 27
#, read-only
msgid "This documentation assumes familiarity with __Asio__ and"
msgstr "This documentation assumes familiarity with __Asio__ and"

#. type: heading
#: 39
#, read-only
msgid "Construction"
msgstr "Construction"

#. type: paragraph
#: 41
#, read-only
msgid ""
"A WebSocket connection requires a stateful object, represented in Beast by a "
"single class template [link beast.ref.boost__beast__websocket__stream "
"`websocket::stream`]. The interface uses the layered stream model. A "
"websocket stream object contains another stream object, called the \"next "
"layer\", which it uses to perform I/O. Descriptions of each template "
"parameter follow:"
msgstr ""
"A WebSocket connection requires a stateful object, represented in Beast by a "
"single class template [link beast.ref.boost__beast__websocket__stream "
"`websocket::stream`]. The interface uses the layered stream model. A "
"websocket stream object contains another stream object, called the \"next "
"layer\", which it uses to perform I/O. Descriptions of each template "
"parameter follow:"

#. type: table title
#: 50
#, read-only
msgid "WebSocket Stream Template Parameters"
msgstr "WebSocket Stream Template Parameters"

#. type: table cell
#: 50
#, read-only
msgid "Name"
msgstr "Name"

#. type: table cell
#: 50
#, read-only
msgid "Description"
msgstr "Description"

#. type: table cell
#: 50
#, read-only
msgid "`NextLayer`"
msgstr "`NextLayer`"

#. type: table cell
#: 50
#, read-only
msgid ""
"The type of the next layer. An object of this type will be constructed and "
"maintained for the lifetime of the stream. All reads and writes will go "
"through the next layer. This type must meet the requirements of either "
"__SyncStream__, __AsyncStream__, or both, depending on the style of I/O that "
"is to be performed."
msgstr ""
"The type of the next layer. An object of this type will be constructed and "
"maintained for the lifetime of the stream. All reads and writes will go "
"through the next layer. This type must meet the requirements of either "
"__SyncStream__, __AsyncStream__, or both, depending on the style of I/O that "
"is to be performed."

#. type: table cell
#: 50
#, read-only
msgid "`deflateSupported`"
msgstr "`deflateSupported`"

#. type: table cell
#: 50
#, read-only
msgid ""
"When this value is `true`, the stream will support (but not require) the "
"[@https://tools.ietf.org/html/rfc7692 permessage-deflate extension]. Whether "
"or not the stream actually requests or accepts the extension during a "
"handshake depends on a separate configurable option.\n"
"\n"
"When the value is `false` the extension is disabled. Streams will never "
"request the extension in the client role or accept a request for the "
"extension in the server role. An additional benefit of disabling the "
"extension is that compilation will be faster, and the resulting program "
"executable will contain less code."
msgstr ""
"When this value is `true`, the stream will support (but not require) the "
"[@https://tools.ietf.org/html/rfc7692 permessage-deflate extension]. Whether "
"or not the stream actually requests or accepts the extension during a "
"handshake depends on a separate configurable option.\n"
"\n"
"When the value is `false` the extension is disabled. Streams will never "
"request the extension in the client role or accept a request for the "
"extension in the server role. An additional benefit of disabling the "
"extension is that compilation will be faster, and the resulting program "
"executable will contain less code."

#. type: paragraph
#: 77
#, read-only
msgid ""
"When a stream is constructed, any arguments provided to the constructor are "
"forwarded to the next layer object's constructor. This declares a stream "
"over a plain TCP/IP socket using an I/O context:"
msgstr ""
"When a stream is constructed, any arguments provided to the constructor are "
"forwarded to the next layer object's constructor. This declares a stream "
"over a plain TCP/IP socket using an I/O context:"

#. type: paragraph
#: 84
#, read-only
msgid "Websocket streams use their own protocol-specific timeout feature. When"
msgstr "Websocket streams use their own protocol-specific timeout feature. When"

#. type: paragraph
#: 93
#, read-only
msgid ""
"As with most I/O objects, a websocket stream is [*not thread-safe]. "
"Undefined behavior results if two different threads access the object "
"concurrently. For multi-threaded programs, the `tcp_stream` can be "
"constructed from an executor, in this case a strand. The stream declared "
"below will use a strand to invoke all completion handlers:"
msgstr ""
"As with most I/O objects, a websocket stream is [*not thread-safe]. "
"Undefined behavior results if two different threads access the object "
"concurrently. For multi-threaded programs, the `tcp_stream` can be "
"constructed from an executor, in this case a strand. The stream declared "
"below will use a strand to invoke all completion handlers:"

#. type: paragraph
#: 101
#, read-only
msgid ""
"If the next layer supports move-construction, then the websocket stream can "
"be constructed from a moved-from object."
msgstr ""
"If the next layer supports move-construction, then the websocket stream can "
"be constructed from a moved-from object."

#. type: paragraph
#: 106
#, read-only
msgid ""
"The next layer may be accessed by calling [link "
"beast.ref.boost__beast__websocket__stream.next_layer.overload1 "
"`stream::next_layer`]."
msgstr ""
"The next layer may be accessed by calling [link "
"beast.ref.boost__beast__websocket__stream.next_layer.overload1 "
"`stream::next_layer`]."

#. type: heading
#: 113
#, read-only
msgid "Using SSL"
msgstr "Using SSL"

#. type: paragraph
#: 115
#, read-only
msgid ""
"To use WebSockets over SSL, use an instance of the __ssl_stream__ class "
"template as the template type for the stream. The required __io_context__ "
"and __ssl_context__ arguments are forwarded to the wrapped stream's "
"constructor:"
msgstr ""
"To use WebSockets over SSL, use an instance of the __ssl_stream__ class "
"template as the template type for the stream. The required __io_context__ "
"and __ssl_context__ arguments are forwarded to the wrapped stream's "
"constructor:"

#. type: paragraph
#: 123
#, read-only
msgid "Code which declares websocket stream objects using Asio SSL types"
msgstr "Code which declares websocket stream objects using Asio SSL types"

#. type: paragraph
#: 127
#, read-only
msgid ""
"As before, the underlying SSL stream may be accessed by calling `next_layer`."
msgstr ""
"As before, the underlying SSL stream may be accessed by calling `next_layer`."

#. type: paragraph
#: 131
#, read-only
msgid ""
"With multi-layered streams such as the one declared above, accessing an "
"individual layer can be cumbersome when using chained calls to `next_layer`. "
"The function [link beast.ref.boost__beast__get_lowest_layer "
"`get_lowest_layer`] returns the last stream in a stack of layers in a "
"layered stream. Here we access the lowest layer to cancel all outstanding I/"
"O."
msgstr ""
"With multi-layered streams such as the one declared above, accessing an "
"individual layer can be cumbersome when using chained calls to `next_layer`. "
"The function [link beast.ref.boost__beast__get_lowest_layer "
"`get_lowest_layer`] returns the last stream in a stack of layers in a "
"layered stream. Here we access the lowest layer to cancel all outstanding I/"
"O."

#. type: heading
#: 142
#, read-only
msgid "Non-Blocking Mode"
msgstr "Non-Blocking Mode"

#. type: paragraph
#: 144
#, read-only
msgid "Please note that websocket streams do not support non-blocking modes."
msgstr "Please note that websocket streams do not support non-blocking modes."
