Beast Logo

PrevUpHomeNext

websocket::keep_alive

Keep-alive option.

using keep_alive = implementation-defined;

Determines if the connection is closed after a failed upgrade request.

This setting only affects the behavior of HTTP requests that implicitly or explicitly ask for a keepalive. For HTTP requests that indicate the connection should be closed, the connection is closed as per rfc7230.

The default setting is to close connections after a failed upgrade request.

Remarks

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

Example

Setting the keep alive option.

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

Header: beast/websocket/option.hpp

Convenience header: beast/websocket.hpp


PrevUpHomeNext