forked from boostorg/beast
Replace uses of net::coroutine with asio::coroutine
`asio::coroutine` is an extension, which is not part of the Networking TS, so the `net` alias is not appropriate in this case. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
17 files changed
+31
-30
No files matched your search
@@ -41,7 +41,7 @@ async_echo (AsyncStream& stream, DynamicBuffer& buffer, CompletionToken&& token)
|
||||
This function is used to asynchronously read a line ending
|
||||
in a newline (`"\n"`) from the stream, and then write
|
||||
it back.
|
||||
|
||||
|
||||
This call always returns immediately. The asynchronous operation
|
||||
will continue until one of the following conditions is true:
|
||||
|
||||
@@ -76,7 +76,7 @@ async_echo (AsyncStream& stream, DynamicBuffer& buffer, CompletionToken&& token)
|
||||
beast::error_code error // Result of operation.
|
||||
);
|
||||
@endcode
|
||||
|
||||
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
@@ -161,10 +161,10 @@ async_echo(
|
||||
|
||||
// This nested class implements the echo composed operation as a
|
||||
// stateful completion handler. We derive from `async_base` to
|
||||
// take care of boilerplate and we derived from net::coroutine to
|
||||
// take care of boilerplate and we derived from asio::coroutine to
|
||||
// allow the reenter and yield keywords to work.
|
||||
|
||||
struct echo_op : base_type, net::coroutine
|
||||
struct echo_op : base_type, boost::asio::coroutine
|
||||
{
|
||||
AsyncStream& stream_;
|
||||
DynamicBuffer& buffer_;
|
||||
|
||||
@@ -238,7 +238,7 @@ fail(beast::error_code ec, char const* what)
|
||||
|
||||
// Handles an HTTP server connection
|
||||
class session
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<session>
|
||||
{
|
||||
// This is the C++11 equivalent of a generic lambda.
|
||||
@@ -398,7 +398,7 @@ public:
|
||||
|
||||
// Accepts incoming connections and launches the sessions
|
||||
class listener
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<listener>
|
||||
{
|
||||
net::io_context& ioc_;
|
||||
|
||||
@@ -214,7 +214,7 @@ fail(beast::error_code ec, char const* what)
|
||||
|
||||
// Handles an HTTP server connection
|
||||
class session
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<session>
|
||||
{
|
||||
// This is the C++11 equivalent of a generic lambda.
|
||||
@@ -344,7 +344,7 @@ public:
|
||||
|
||||
// Accepts incoming connections and launches the sessions
|
||||
class listener
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<listener>
|
||||
{
|
||||
net::io_context& ioc_;
|
||||
@@ -407,7 +407,7 @@ public:
|
||||
private:
|
||||
|
||||
#include <boost/asio/yield.hpp>
|
||||
|
||||
|
||||
void
|
||||
loop(beast::error_code ec = {})
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ fail(beast::error_code ec, char const* what)
|
||||
|
||||
// Echoes back all received WebSocket messages
|
||||
class session
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<session>
|
||||
{
|
||||
websocket::stream<beast::ssl_stream<beast::tcp_stream>> ws_;
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
|
||||
// Accepts incoming connections and launches the sessions
|
||||
class listener
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<listener>
|
||||
{
|
||||
net::io_context& ioc_;
|
||||
|
||||
@@ -43,7 +43,7 @@ fail(beast::error_code ec, char const* what)
|
||||
|
||||
// Echoes back all received WebSocket messages
|
||||
class session
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<session>
|
||||
{
|
||||
websocket::stream<beast::tcp_stream> ws_;
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
}
|
||||
|
||||
#include <boost/asio/yield.hpp>
|
||||
|
||||
|
||||
void
|
||||
loop(
|
||||
beast::error_code ec,
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
|
||||
// Accepts incoming connections and launches the sessions
|
||||
class listener
|
||||
: public net::coroutine
|
||||
: public boost::asio::coroutine
|
||||
, public std::enable_shared_from_this<listener>
|
||||
{
|
||||
net::io_context& ioc_;
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
private:
|
||||
|
||||
#include <boost/asio/yield.hpp>
|
||||
|
||||
|
||||
void
|
||||
loop(beast::error_code ec = {})
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user