Replace uses of net::spawn with asio::spawn

`asio::spawn` 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:
Damian Jarek
2019-06-16 23:56:06 +02:00
parent f10dc38ae6
commit 8d5bd286d7
13 changed files with 20 additions and 19 deletions

View File

@@ -11,6 +11,7 @@ Version 259:
* Fix coverage collection in AzP CI
* Improve performance of `http::string_to_verb`
* Replace uses of `net::coroutine` with `asio::coroutine`
* Replace uses of `net::spawn` with `asio::spawn`
--------------------------------------------------------------------------------

View File

@@ -290,7 +290,7 @@ in place of the completion handler. The same `async_write` function overload
can work with a
[@https://en.wikipedia.org/wiki/Fiber_(computer_science) ['fiber]]
launched with
[@boost:/doc/html/boost_asio/reference/spawn/overload1.html `net::spawn`]:
[@boost:/doc/html/boost_asio/reference/spawn/overload1.html `asio::spawn`]:
[code_core_1_refresher_5s]

View File

@@ -162,7 +162,7 @@ int main(int argc, char** argv)
ctx.set_verify_mode(ssl::verify_peer);
// Launch the asynchronous operation
net::spawn(ioc, std::bind(
boost::asio::spawn(ioc, std::bind(
&do_session,
std::string(host),
std::string(port),

View File

@@ -127,7 +127,7 @@ int main(int argc, char** argv)
net::io_context ioc;
// Launch the asynchronous operation
net::spawn(ioc, std::bind(
boost::asio::spawn(ioc, std::bind(
&do_session,
std::string(host),
std::string(port),

View File

@@ -371,7 +371,7 @@ do_listen(
if(ec)
fail(ec, "accept");
else
net::spawn(
boost::asio::spawn(
acceptor.get_executor(),
std::bind(
&do_session,
@@ -408,7 +408,7 @@ int main(int argc, char* argv[])
load_server_certificate(ctx);
// Spawn a listening port
net::spawn(ioc,
boost::asio::spawn(ioc,
std::bind(
&do_listen,
std::ref(ioc),

View File

@@ -334,7 +334,7 @@ do_listen(
if(ec)
fail(ec, "accept");
else
net::spawn(
boost::asio::spawn(
acceptor.get_executor(),
std::bind(
&do_session,
@@ -364,7 +364,7 @@ int main(int argc, char* argv[])
net::io_context ioc{threads};
// Spawn a listening port
net::spawn(ioc,
boost::asio::spawn(ioc,
std::bind(
&do_listen,
std::ref(ioc),

View File

@@ -153,7 +153,7 @@ int main(int argc, char** argv)
load_root_certificates(ctx);
// Launch the asynchronous operation
net::spawn(ioc, std::bind(
boost::asio::spawn(ioc, std::bind(
&do_session,
std::string(host),
std::string(port),

View File

@@ -132,7 +132,7 @@ int main(int argc, char** argv)
net::io_context ioc;
// Launch the asynchronous operation
net::spawn(ioc, std::bind(
boost::asio::spawn(ioc, std::bind(
&do_session,
std::string(host),
std::string(port),

View File

@@ -148,7 +148,7 @@ do_listen(
if(ec)
fail(ec, "accept");
else
net::spawn(
boost::asio::spawn(
acceptor.get_executor(),
std::bind(
&do_session,
@@ -183,7 +183,7 @@ int main(int argc, char* argv[])
load_server_certificate(ctx);
// Spawn a listening port
net::spawn(ioc,
boost::asio::spawn(ioc,
std::bind(
&do_listen,
std::ref(ioc),

View File

@@ -129,7 +129,7 @@ do_listen(
if(ec)
fail(ec, "accept");
else
net::spawn(
boost::asio::spawn(
acceptor.get_executor(),
std::bind(
&do_session,
@@ -158,7 +158,7 @@ int main(int argc, char* argv[])
net::io_context ioc(threads);
// Spawn a listening port
net::spawn(ioc,
boost::asio::spawn(ioc,
std::bind(
&do_listen,
std::ref(ioc),

View File

@@ -100,7 +100,7 @@ do_sync_session(websocket::stream<beast::tcp_stream>& ws)
for(;;)
{
beast::flat_buffer buffer;
ws.read(buffer, ec);
if(ec == websocket::error::closed)
break;
@@ -405,7 +405,7 @@ do_coro_listen(
continue;
}
net::spawn(
boost::asio::spawn(
acceptor.get_executor(),
std::bind(
&do_coro_session,
@@ -456,7 +456,7 @@ int main(int argc, char* argv[])
static_cast<unsigned short>(port + 1u)})->run();
// Create coro port
net::spawn(ioc,
boost::asio::spawn(ioc,
std::bind(
&do_coro_listen,
std::ref(ioc),

View File

@@ -73,7 +73,7 @@ snippets()
}
{
//[code_core_1_refresher_5s
net::spawn(
asio::spawn(
[&sock](net::yield_context yield)
{
std::size_t bytes_transferred = net::async_write(sock,
@@ -375,7 +375,7 @@ async_write(
>::return_type
{
//[code_core_1_refresher_10
return net::async_initiate<
CompletionToken,
void(error_code, std::size_t)>(

View File

@@ -120,7 +120,7 @@ void
enable_yield_to::
spawn(F0&& f, FN&&... fn)
{
net::spawn(ioc_,
asio::spawn(ioc_,
[&](yield_context yield)
{
f(yield);