Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext
websocket::stream::write_buffer_size (1 of 2 overloads)

Set the write buffer size option.

Synopsis
void
write_buffer_size(
    std::size_t amount);
Description

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.

Example

Setting the write buffer size.

ws.write_buffer_size(8192);
Parameters

Name

Description

amount

The size of the write buffer in bytes.


PrevUpHomeNext