| Home | Libraries | People | FAQ | More

###### websocket::stream::read_size_hint (2 of 2 overloads)

Returns a suggested maximum buffer size for the next call to read.

###### Synopsis

    template<
        class DynamicBuffer>
    std::size_t
    read_size_hint(
        DynamicBuffer& buffer) const;

###### Description

This function returns a reasonable upper limit on the number of bytes for the size of the buffer passed in the next call to read. The number is determined by the state of the current frame and whether or not the permessage-deflate extension is enabled.

###### Parameters

Name | Description
--- | ---
`buffer` | The buffer which will be used for reading. The implementation will query the buffer to obtain the optimum size of a subsequent call to `buffer.prepare` based on the state of the current frame, if any.