beast icon indicating copy to clipboard operation
beast copied to clipboard

async_close do not recv peer close frame

Open ahao1995 opened this issue 1 year ago • 5 comments

I use async_close to close the socket, but after 5min recv callback, have any method to force close the connection, and not wait the close frame may be I should call

std::optional<boost::beast::websocket::stream<
    boost::beast::ssl_stream<boost::beast::tcp_stream>>> ws_stream_;
//force close?
boost::beast::get_lowest_layer(*ws_stream_).cancel();

after that I want to do reconnect

ws_stream_.emplace(exec_, ctx_);

it is right? thanks

ahao1995 avatar Aug 08 '24 09:08 ahao1995