mirror of
https://github.com/boostorg/beast.git
synced 2026-05-03 19:30:50 +02:00
Fixes to support Asio changes (API Change):
This adjusts Beast's interfaces and implementation to match the changes in Boost.Asio.
This commit is contained in:
@@ -45,8 +45,8 @@ fail(beast::error_code ec, char const* what)
|
||||
class session : public std::enable_shared_from_this<session>
|
||||
{
|
||||
tcp::resolver resolver_;
|
||||
websocket::stream<beast::ssl_stream<
|
||||
beast::tcp_stream<net::io_context::executor_type>>> ws_;
|
||||
websocket::stream<
|
||||
beast::ssl_stream<beast::tcp_stream>> ws_;
|
||||
beast::multi_buffer buffer_;
|
||||
std::string host_;
|
||||
std::string text_;
|
||||
@@ -55,8 +55,8 @@ public:
|
||||
// Resolver and socket require an io_context
|
||||
explicit
|
||||
session(net::io_context& ioc, ssl::context& ctx)
|
||||
: resolver_(ioc)
|
||||
, ws_(ioc, ctx)
|
||||
: resolver_(beast::make_strand(ioc))
|
||||
, ws_(beast::make_strand(ioc), ctx)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,7 @@ fail(beast::error_code ec, char const* what)
|
||||
class session : public std::enable_shared_from_this<session>
|
||||
{
|
||||
tcp::resolver resolver_;
|
||||
websocket::stream<
|
||||
beast::tcp_stream<net::io_context::executor_type>> ws_;
|
||||
websocket::stream<beast::tcp_stream> ws_;
|
||||
beast::multi_buffer buffer_;
|
||||
std::string host_;
|
||||
std::string text_;
|
||||
@@ -50,8 +49,8 @@ public:
|
||||
// Resolver and socket require an io_context
|
||||
explicit
|
||||
session(net::io_context& ioc)
|
||||
: resolver_(ioc)
|
||||
, ws_(ioc)
|
||||
: resolver_(beast::make_strand(ioc))
|
||||
, ws_(beast::make_strand(ioc))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ do_session(
|
||||
beast::error_code ec;
|
||||
|
||||
// These objects perform our I/O
|
||||
tcp::resolver resolver{ioc};
|
||||
websocket::stream<beast::ssl_stream<
|
||||
beast::tcp_stream<net::io_context::executor_type>>> ws(ioc, ctx);
|
||||
tcp::resolver resolver(ioc);
|
||||
websocket::stream<
|
||||
beast::ssl_stream<beast::tcp_stream>> ws(ioc, ctx);
|
||||
|
||||
// Look up the domain name
|
||||
auto const results = resolver.async_resolve(host, port, yield[ec]);
|
||||
|
||||
@@ -48,9 +48,8 @@ do_session(
|
||||
beast::error_code ec;
|
||||
|
||||
// These objects perform our I/O
|
||||
tcp::resolver resolver{ioc};
|
||||
websocket::stream<
|
||||
beast::tcp_stream<net::io_context::executor_type>> ws(ioc);
|
||||
tcp::resolver resolver(ioc);
|
||||
websocket::stream<beast::tcp_stream> ws(ioc);
|
||||
|
||||
// Look up the domain name
|
||||
auto const results = resolver.async_resolve(host, port, yield[ec]);
|
||||
|
||||
Reference in New Issue
Block a user