| Home | Libraries | People | FAQ | More

###### websocket::stream::write_buffer_bytes (1 of 2 overloads)

Set the write buffer size option.

<h7> Synopsis </h7>

    void
    write_buffer_bytes(
        std::size_t amount);

<h7> Description </h7>

Sets the size of the write buffer used by the implementation to send frames. The write buffer is needed when masking payload data in the client role, compressing frames, or auto-fragmenting message data. Lowering the size of the buffer can decrease the memory requirements for each connection, while increasing the size of the buffer can reduce the number of calls made to the next layer to write data. The default setting is 4096. The minimum value is 8. The write buffer size can only be changed when the stream is not open. Undefined behavior results if the option is modified after a successful WebSocket handshake.

<h7> Example </h7>

Setting the write buffer size.

    ws.write_buffer_bytes(8192);

<h7> Parameters </h7>

Name | Description
--- | ---
`amount` | The size of the write buffer in bytes.