make_strand is in net::

This commit is contained in:
Vinnie Falco
2019-03-02 07:33:57 -08:00
parent dfd3752c23
commit fca4b3ae10
32 changed files with 58 additions and 121 deletions
@@ -19,6 +19,7 @@
#include <boost/beast/ssl.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/beast/websocket/ssl.hpp>
#include <boost/asio/strand.hpp>
#include <cstdlib>
#include <functional>
#include <iostream>
@@ -55,8 +56,8 @@ public:
// Resolver and socket require an io_context
explicit
session(net::io_context& ioc, ssl::context& ctx)
: resolver_(beast::make_strand(ioc))
, ws_(beast::make_strand(ioc), ctx)
: resolver_(net::make_strand(ioc))
, ws_(net::make_strand(ioc), ctx)
{
}
@@ -15,6 +15,7 @@
#include <boost/beast/core.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/asio/strand.hpp>
#include <cstdlib>
#include <functional>
#include <iostream>
@@ -49,8 +50,8 @@ public:
// Resolver and socket require an io_context
explicit
session(net::io_context& ioc)
: resolver_(beast::make_strand(ioc))
, ws_(beast::make_strand(ioc))
: resolver_(net::make_strand(ioc))
, ws_(net::make_strand(ioc))
{
}
@@ -183,7 +183,7 @@ public:
tcp::endpoint endpoint)
: ioc_(ioc)
, ctx_(ctx)
, acceptor_(beast::make_strand(ioc))
, acceptor_(net::make_strand(ioc))
{
beast::error_code ec;
@@ -235,7 +235,7 @@ public:
{
// The new connection gets its own strand
acceptor_.async_accept(
beast::make_strand(ioc_),
net::make_strand(ioc_),
beast::bind_front_handler(
&listener::on_accept,
shared_from_this()));
@@ -206,7 +206,7 @@ public:
{
// The new connection gets its own strand
acceptor_.async_accept(
beast::make_strand(ioc_),
net::make_strand(ioc_),
beast::bind_front_handler(
&listener::on_accept,
shared_from_this()));
@@ -62,7 +62,7 @@ run()
{
// The new connection gets its own strand
acceptor_.async_accept(
beast::make_strand(ioc_),
net::make_strand(ioc_),
beast::bind_front_handler(
&listener::on_accept,
shared_from_this()));
@@ -94,7 +94,7 @@ on_accept(beast::error_code ec, tcp::socket socket)
// The new connection gets its own strand
acceptor_.async_accept(
beast::make_strand(ioc_),
net::make_strand(ioc_),
beast::bind_front_handler(
&listener::on_accept,
shared_from_this()));
@@ -249,7 +249,7 @@ public:
net::io_context& ioc,
tcp::endpoint endpoint)
: ioc_(ioc)
, acceptor_(beast::make_strand(ioc))
, acceptor_(net::make_strand(ioc))
{
beast::error_code ec;
@@ -301,7 +301,7 @@ public:
{
// The new connection gets its own strand
acceptor_.async_accept(
beast::make_strand(ioc_),
net::make_strand(ioc_),
beast::bind_front_handler(
&async_listener::on_accept,
shared_from_this()));
@@ -250,7 +250,7 @@ public:
}
// Make sure each session gets its own strand
socket_ = tcp::socket(beast::make_strand(ioc_));
socket_ = tcp::socket(net::make_strand(ioc_));
}
}
}
@@ -151,8 +151,8 @@ public:
net::io_context& ioc,
tcp::endpoint endpoint)
: ioc_(ioc)
, acceptor_(beast::make_strand(ioc))
, socket_(beast::make_strand(ioc))
, acceptor_(net::make_strand(ioc))
, socket_(net::make_strand(ioc))
{
beast::error_code ec;
@@ -224,7 +224,7 @@ public:
}
// Make sure each session gets its own strand
socket_ = tcp::socket(beast::make_strand(ioc_));
socket_ = tcp::socket(net::make_strand(ioc_));
}
}
}