| Home | Libraries | People | FAQ | More

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

Set the maximum incoming message size option.

###### Synopsis

    void
    read_message_max(
        std::size_t amount);

###### Description

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`.

###### Example

Setting the maximum read message size.

    ws.read_message_max(65536);

###### Parameters

Name | Description
--- | ---
`amount` | The limit on the size of incoming messages.