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:
Vinnie Falco
2019-02-18 12:42:24 -08:00
parent ac24e58fb3
commit 6baa607295
58 changed files with 762 additions and 723 deletions
@@ -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]);