<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="NoName" source-language="en" datatype="plaintext" target-language="zh_Hans">
    <body>
      <trans-unit xml:space="preserve" approved="no" id="10">
        <source>Message Stream Operations</source>
        <target state="translated">消息流操作</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">10</context>
        </context-group>
        <note from="developer">type: section title</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="fc2d8ea80a65e244">
        <source>Beast provides synchronous and asynchronous algorithms to parse and serialize HTTP/1 wire format messages on streams. These functions form the message-oriented stream interface:</source>
        <target state="translated">Beast 提供同步和异步算法，用于在流上解析和序列化 HTTP/1 线路格式的消息。这些函数构成面向消息的流接口：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">12</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="16">
        <source>Message Stream Operations</source>
        <target state="translated">消息流操作</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table title</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="b4c4db868dbf643a">
        <source>Name</source>
        <target state="translated">名称</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f7f5c115cf553484">
        <source>Description</source>
        <target state="translated">描述</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="1ec6f3dd52b17d9b">
        <source>[link beast.ref.boost__beast__http__read.overload3 [*read]]</source>
        <target state="translated">[link beast.ref.boost__beast__http__read.overload3 [*read]]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a321f248e9aeffde">
        <source>Read a __message__ from a __SyncReadStream__.</source>
        <target state="translated">从 __SyncReadStream__ 读取 __message__。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a6a2c4b9b048fafb">
        <source>[link beast.ref.boost__beast__http__async_read.overload2 [*async_read]]</source>
        <target state="translated">[link beast.ref.boost__beast__http__async_read.overload2 [*async_read]]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="5ac5751cf65a6ff4">
        <source>Read a __message__ from an __AsyncReadStream__.</source>
        <target state="translated">从 __AsyncReadStream__ 读取 __message__。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="881b8e8cbde281aa">
        <source>[link beast.ref.boost__beast__http__write.overload1 [*write]]</source>
        <target state="translated">[link beast.ref.boost__beast__http__write.overload1 [*write]]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="d39da5908ab7961b">
        <source>Write a __message__ to a __SyncWriteStream__.</source>
        <target state="translated">将 __message__ 写入 __SyncWriteStream__。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="3d36732a6c717791">
        <source>[link beast.ref.boost__beast__http__async_write [*async_write]]</source>
        <target state="translated">[link beast.ref.boost__beast__http__async_write [*async_write]]</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="acc31ab66e0d401f">
        <source>Write a __message__ to an __AsyncWriteStream__.</source>
        <target state="translated">将 __message__ 写入 __AsyncWriteStream__。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">16</context>
        </context-group>
        <note from="developer">type: table cell</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="a2681e006b5005fc">
        <source>All synchronous stream operations come in two varieties. One which throws an exception upon error, and another which accepts as the last parameter an argument of type [link beast.ref.boost__beast__error_code `error_code&amp;`]. If an error occurs this argument will be set to contain the error code.</source>
        <target state="translated">所有同步流操作都提供两种形式：一种在出错时抛出异常，另一种则在参数列表末尾接受一个类型为 [link beast.ref.boost__beast__error_code `error_code&amp;`] 的引用参数。如果操作出错，该参数会被设置为对应的错误码。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">40</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f6425434a43788e2">
        <source>Reading</source>
        <target state="translated">读取</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">47</context>
        </context-group>
        <note from="developer">type: heading</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f1c689e958655d09">
        <source>Because a serialized header is not length-prefixed, algorithms which parse messages from a stream may read past the end of a message for efficiency. To hold this surplus data, all stream read operations use a passed-in __DynamicBuffer__ which must be persisted between calls until the end of stream is reached or the stream object is destroyed. Each read operation may consume bytes remaining in the buffer, and leave behind new bytes. In this example we declare the buffer and a message variable, then read a complete HTTP request synchronously:</source>
        <target state="translated">由于序列化后的头部没有长度前缀，从流中解析消息的算法为了提高效率，可能会读取超过消息末尾的数据。为了保存这些多余的数据，所有流读操作都依赖一个传入的 __DynamicBuffer__，该缓冲区在两次调用之间必须保持有效，直到流结束或流对象销毁为止。每次读操作可能会消耗缓冲区中已有的字节，也可能留下新读入的字节。以下示例声明一个缓冲区和一个消息变量，然后同步读取一个完整的 HTTP 请求：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">49</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="f7f48d7453e5f367">
        <source>This example uses __flat_buffer__. Beast's __basic_parser__ is optimized for structured HTTP data located in a single contiguous (['flat]) memory buffer. When not using a flat buffer the implementation may perform an additional memory allocations to restructure the input into a single buffer for parsing.</source>
        <target state="translated">该示例使用 __flat_buffer__。Beast 的 __basic_parser__ 针对位于单个连续（扁平）内存缓冲区中的结构化 HTTP 数据进行了优化。若未使用扁平缓冲区，实现可能需要进行额外的内存分配，将输入数据重新组织为单个缓冲区以便解析。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">60</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="d2ae4c8164de8de4">
        <source>Other Implementations of __DynamicBuffer__ may avoid parser</source>
        <target state="translated">其他 __DynamicBuffer__ 实现可能避免使用解析器。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">67</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="da27434098b3fcd0">
        <source>Messages may also be read asynchronously. When performing asynchronous stream read operations the stream, buffer, and message variables must remain valid until the operation has completed. Beast asynchronous initiation functions use Asio's completion handler model. This call reads a message asynchronously and reports the error code upon completion. The handler is called with the error, set to any that occurs, and the number of bytes parsed. This number may be used to measure the relative amount of work performed, or it may be ignored as this example shows.</source>
        <target state="translated">消息也支持异步读取。在执行异步流读操作期间，流对象、缓冲区和消息变量必须保持有效，直到操作完成。Beast 的异步发起函数采用 Asio 的完成处理器模型。该调用会异步读取消息，并在操作完成时将错误码传递给处理器。处理器被调用时，会收到发生的错误和已解析的字节数。这个字节数可以用于衡量相对的工作量，也可以像示例中那样直接忽略。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">72</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="50a9f87c9e5f8af0">
        <source>If a read stream algorithm cannot complete its operation without exceeding the maximum specified size of the dynamic buffer provided, the error [link beast.ref.boost__beast__http__error `buffer_overflow`] is returned. This is one technique which may be used to impose a limit on the maximum size of an HTTP message header for protection from buffer overflow attacks. The following code will print the error message:</source>
        <target state="translated">如果流读取算法在操作过程中超出所提供动态缓冲区的最大大小限制，则会返回 [link beast.ref.boost__beast__http__error `buffer_overflow`] 错误。这是一种可用于限制 HTTP 消息头部最大大小、以防止缓冲区溢出攻击的手段。以下代码用于输出该错误信息：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">84</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="728c109b7cbbf557">
        <source>Writing</source>
        <target state="translated">写入</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">95</context>
        </context-group>
        <note from="developer">type: heading</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="e1b715c3817b273e">
        <source>A set of free functions allow serialization of an entire HTTP message to a stream. This example constructs and sends an HTTP response:</source>
        <target state="translated">一组自由函数可用于将完整的 HTTP 消息序列化并写入流。以下示例构造并发送一个 HTTP 响应：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">97</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="bee2a8e730afbcd4">
        <source>The asynchronous version could be used instead:</source>
        <target state="translated">也可以使用异步版本替代：</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">102</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
      <trans-unit xml:space="preserve" approved="no" id="e43fff28374d249a">
        <source>The completion handler is called with the number of bytes written to the stream, which includes protocol specific data such as the delimiters in the header and line endings. The number may be used to measure the amount of data transferred, or it may be ignored as in the example.</source>
        <target state="translated">完成处理器被调用时，会收到已写入流的字节数，该数量包含协议特定数据（例如头部中的分隔符和行结束符）。此数值可用于衡量传输的数据量，也可像示例中那样直接忽略。</target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">106</context>
        </context-group>
        <note from="developer">type: paragraph</note>
      </trans-unit>
    </body>
  </file>
</xliff>
