ssl_stream does not use flat_stream

We no longer need to use flat_stream to improve write performance, as
Asio now linearizes scatter/gather I/O in ssl::stream:
https://github.com/chriskohlhoff/asio/commit/17637a48ccbfa2f63941d8393a7c8316a8df4a79
This commit is contained in:
Mohammad Nejati
2024-05-31 16:45:52 +03:30
committed by Mohammad Nejati
parent 6dd3cf7ab1
commit bd804b6520
6 changed files with 29 additions and 678 deletions
@@ -80,7 +80,7 @@ setup_stream(websocket::stream<NextLayer>& ws)
//------------------------------------------------------------------------------
void
do_sync_session(websocket::stream<beast::tcp_stream> ws)
do_sync_session(websocket::stream<beast::tcp_stream>& ws)
{
beast::error_code ec;
@@ -129,10 +129,10 @@ do_sync_listen(
if(ec)
return fail(ec, "accept");
std::thread{
do_sync_session,
websocket::stream<beast::tcp_stream>(std::move(socket))
}.detach();
std::thread(std::bind(
&do_sync_session,
websocket::stream<beast::tcp_stream>(
std::move(socket)))).detach();
}
}
@@ -441,11 +441,13 @@ int main(int argc, char* argv[])
net::io_context ioc{threads};
// Create sync port
std::thread{
do_sync_listen,
std::thread(beast::bind_front_handler(
&do_sync_listen,
std::ref(ioc),
tcp::endpoint{address, static_cast<unsigned short>(port + 0u)}
}.detach();
tcp::endpoint{
address,
static_cast<unsigned short>(port + 0u)}
)).detach();
// Create async port
std::make_shared<async_listener>(