std::ostream& log_;
net::io_context ioc_;
- net::executor_work_guard<
- net::io_context::executor_type> work_;
+ net::any_io_executor work_;
static_buffer<buf_size> buffer_;
test::stream ts_;
std::thread t_;
std::ostream& log,
kind k = kind::sync)
: log_(log)
- , work_(ioc_.get_executor())
+ , work_(net::require(ioc_.get_executor(),
+ net::execution::outstanding_work.tracked))
, ts_(ioc_)
, ws_(ts_)
{
~echo_server()
{
- work_.reset();
+ work_ = {};
t_.join();
}
{
error_code ec;
ws.async_accept(handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_accept(buffers, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_accept(req, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_accept_ex(d, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_accept_ex(buffers, d, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_accept_ex(req, d, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
error_code ec;
ws.async_accept_ex(
req, buffers, d, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
error_code ec;
ws.async_handshake(
uri, path, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
error_code ec;
ws.async_handshake(
res, uri, path, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
error_code ec;
ws.async_handshake_ex(
uri, path, d, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
error_code ec;
ws.async_handshake_ex(
res, uri, path, d, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_ping(payload, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_pong(payload, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
{
error_code ec;
ws.async_close(cr, handler(ec));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
}
error_code ec;
std::size_t n;
ws.async_read(buffer, handler(ec, n));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
return n;
error_code ec;
std::size_t n;
ws.async_read_some(buffer, limit, handler(ec, n));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
return n;
error_code ec;
std::size_t n;
ws.async_read_some(buffers, handler(ec, n));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
return n;
error_code ec;
std::size_t n;
ws.async_write(buffers, handler(ec, n));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
return n;
error_code ec;
std::size_t n;
ws.async_write_some(fin, buffers, handler(ec, n));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
return n;
std::size_t n;
net::async_write(ws.next_layer(),
buffers, handler(ec, n));
- ws.get_executor().context().run();
- ws.get_executor().context().restart();
+ net::query(ws.get_executor(), net::execution::context).run();
+ net::query(ws.get_executor(), net::execution::context).restart();
if(ec)
throw system_error{ec};
return n;