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 13:31+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-06-websocket-06-timeouts-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
#: 12
msgid "Timeouts"
msgstr "超时"

#. type: paragraph
#: 14
msgid ""
"While [link beast.ref.boost__beast__basic_stream `basic_stream`] and [link "
"beast.ref.boost__beast__basic_stream `tcp_stream`] support timeouts on "
"general logical operations, the websocket stream has a more sophisticated "
"timeout mechanism built-in which may be enabled and configured. The timeout "
"features of the TCP or basic stream should not be used when working with a "
"websocket stream. The interface to these timeout features is shown in this "
"table."
msgstr ""
"尽管 [link beast.ref.boost__beast__basic_stream `basic_stream`] 和 [link "
"beast.ref.boost__beast__basic_stream `tcp_stream`] 支持对常规逻辑操作设置超时"
"，但 WebSocket 流内置了更复杂的超时机制，可以启用并进行配置。在使用 "
"WebSocket 流时，不应使用 TCP 或基础流的超时功能。这些超时功能的接口如下表所示"
"。"

#. type: table title
#: 22
msgid "WebSocket Timeout Interface"
msgstr "WebSocket 超时接口"

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

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

#. type: table cell
#: 22
msgid ""
"[link beast.ref.boost__beast__websocket__stream_base__timeout "
"`stream_base::timeout`]"
msgstr ""
"[link beast.ref.boost__beast__websocket__stream_base__timeout "
"`stream_base::timeout`]"

#. type: table cell
#: 22
msgid "This represents configured timeout settings for a websocket stream."
msgstr "该结构表示 WebSocket 流的超时配置设置。"

#. type: table cell
#: 22
msgid ""
"[link beast.ref.boost__beast__websocket__stream_base__timeout.suggested "
"`stream_base::timeout::suggested`]"
msgstr ""
"[link beast.ref.boost__beast__websocket__stream_base__timeout.suggested "
"`stream_base::timeout::suggested`]"

#. type: table cell
#: 22
msgid ""
"This function returns the suggested timeout settings for a given role "
"(client or server)."
msgstr "该函数返回给定角色（客户端或服务器）的建议超时设置。"

#. type: table cell
#: 22
msgid ""
"[link beast.ref.boost__beast__websocket__stream.set_option "
"`stream::set_option`]"
msgstr ""
"[link beast.ref.boost__beast__websocket__stream.set_option "
"`stream::set_option`]"

#. type: table cell
#: 22
msgid "This function sets timeout and other options on the stream."
msgstr "该函数用于在流上设置超时及其他选项。"

#. type: paragraph
#: 42
msgid ""
"There are three timeout settings which may be set independently on the "
"stream:"
msgstr "流上可以独立设置三种超时配置："

#. type: table title
#: 44
msgid "WebSocket Timeout Interface (2)"
msgstr "WebSocket 超时接口（2）"

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

#. type: table cell
#: 44
msgid "Type"
msgstr "类型"

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

#. type: table cell
#: 44
msgid ""
"[link "
"beast.ref.boost__beast__websocket__stream_base__timeout.handshake_timeout "
"`timeout::handshake_timeout`]"
msgstr ""
"[link "
"beast.ref.boost__beast__websocket__stream_base__timeout.handshake_timeout "
"`timeout::handshake_timeout`]"

#. type: table cell
#.
#: 44
msgctxt "44"
msgid "`duration`"
msgstr ""

#. type: table cell
#: 44
msgid ""
"This is the amount of time after which a handshake will time out. The "
"handshake timeout applies to client handshakes, server handshakes, as well "
"as the websocket closing handshake performed when either end of the "
"connection wish to shut down. The value returned by [link "
"beast.ref.boost__beast__websocket__stream_base.none `stream_base::none()`] "
"may be assigned to disable this timeout."
msgstr ""
"该值表示握手超时的时间长度。该超时适用于客户端握手、服务器握手，以及连接任一"
"端希望关闭时执行的 WebSocket 关闭握手。可将 [link "
"beast.ref.boost__beast__websocket__stream_base.none `stream_base::none()`] 的"
"返回值赋给该值以禁用此超时。"

#. type: table cell
#: 44
msgid ""
"[link beast.ref.boost__beast__websocket__stream_base__timeout.idle_timeout "
"`timeout::idle_timeout`]"
msgstr ""
"[link beast.ref.boost__beast__websocket__stream_base__timeout.idle_timeout "
"`timeout::idle_timeout`]"

#. type: table cell
#: 44
msgid ""
"If no data or control frames are received from the peer for a time equal to "
"the idle timeout, then the connection will time out. The value returned by "
"[link beast.ref.boost__beast__websocket__stream_base.none `stream_base::none"
"()`] may be assigned to disable this timeout."
msgstr ""
"如果在对端没有收到数据或控制帧的时间达到空闲超时设定值，则连接将触发超时。可"
"将 [link beast.ref.boost__beast__websocket__stream_base.none "
"`stream_base::none()`] 的返回值赋给该值以禁用此超时。"

#. type: table cell
#: 44
msgid ""
"[link "
"beast.ref.boost__beast__websocket__stream_base__timeout.keep_alive_pings "
"`timeout::keep_alive_pings`]"
msgstr ""
"[link "
"beast.ref.boost__beast__websocket__stream_base__timeout.keep_alive_pings "
"`timeout::keep_alive_pings`]"

#. type: table cell
#: 44
msgid "`bool`"
msgstr "`bool`（布尔值）"

#. type: table cell
#: 44
msgid ""
"If the idle timeout is enabled, then the value of this setting controls "
"whether or not a ping frame will be sent to the peer if no data is received "
"for half of the idle timeout interval."
msgstr ""
"如果空闲超时启用，则该设置控制当在空闲超时时间的一半内未收到数据时，是否向对"
"端发送 ping 帧。"

#. type: paragraph
#: 79
msgid ""
"By default, timeouts on websocket streams are disabled. The easiest way to "
"turn them on is to set the suggested timeout settings on the stream."
msgstr ""
"默认情况下，WebSocket 流的超时功能处于禁用状态。启用该功能最简单的方式是在流"
"上设置建议的超时配置。"

#. type: paragraph
#: 84
msgid ""
"For manual control over the settings, a timeout options object may be "
"constructed. Here we enable only the handshake timeout."
msgstr "若需手动控制超时设置，可以构造一个超时选项对象。以下示例用于仅启用手动超时："

#. type: paragraph
#: 89
msgid ""
"Timeout notifications are delivered to the caller by invoking the completion "
"handler for an outstanding asynchronous read operation with the error code "
"[link beast.ref.boost__beast__error `error::timeout`]. The implementation "
"will close the socket or stream before delivering this error. It is not "
"necessary to manually shut down the connection, as it will already be shut "
"down. A read operation must be outstanding for the error to be delivered."
msgstr ""
"超时通知会通过调用未完成的异步读操作的完成处理器传达给调用方，同时附带错误码 "
"[link beast.ref.boost__beast__error `error::timeout`]。在传递此错误之前，实现"
"会关闭套接字或流，因此无需手动关闭连接。要收到该错误，必须存在一个未完成的读"
"操作。"

#. type: note
#: 98
msgid ""
"Websocket timeout features are available only when using asynchronous I/O."
msgstr "WebSocket 超时功能仅在异步 I/O 模式下可用。"

#. type: paragraph
#: 102
msgid ""
"The timeouts on the websocket stream are incompatible with the timeouts used "
"in the `tcp_stream`. When constructing a websocket stream from a tcp stream "
"that has timeouts enabled, the timeout should be disabled first before "
"constructing the websocket stream, as shown."
msgstr ""
"WebSocket 流的超时机制与 tcp_stream 的超时机制不兼容。当从已启用超时的 tcp 流"
"构造 WebSocket 流时，应首先禁用 tcp 流的超时，如下所示。"
