Beast Logo

PrevUpHomeNext

websocket::read_buffer_size

Read buffer size option.

using read_buffer_size = implementation-defined;

Sets the size of the read buffer used by the implementation to receive frames. The read buffer is needed when permessage-deflate is used.

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 read data.

The default setting is 4096. The minimum value is 8.

Remarks

Objects of this type are used with beast::websocket::stream::set_option.

Example

Setting the read buffer size.

...
websocket::stream<ip::tcp::socket> ws(ios);
ws.set_option(read_buffer_size{16 * 1024});
Requirements

Header: beast/websocket/option.hpp

Convenience header: beast/websocket.hpp


PrevUpHomeNext