Beast Logo

PrevUpHomeNext

websocket::read_message_max

Maximum incoming message size option.

using read_message_max = implementation-defined;

Sets the largest permissible incoming message size. Message frame fields indicating a size that would bring the total message size over this limit will cause a protocol failure.

The default setting is 16 megabytes. A value of zero indicates a limit of the maximum value of a std::uint64_t.

Remarks

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

Example

Setting the maximum read message size.

...
websocket::stream<ip::tcp::socket> ws(ios);
ws.set_option(read_message_max{65536});
Requirements

Header: beast/websocket/option.hpp

Convenience header: beast/websocket.hpp


PrevUpHomeNext