forked from boostorg/beast
net is a namespace alias for boost::asio:
The namespace alias beast::net replaces boost::asio in all code and documentation.
This commit is contained in:
@@ -21,8 +21,8 @@ inline
|
||||
void
|
||||
sig_wait()
|
||||
{
|
||||
boost::asio::io_context ioc;
|
||||
boost::asio::signal_set signals(
|
||||
net::io_context ioc;
|
||||
net::signal_set signals(
|
||||
ioc, SIGINT, SIGTERM);
|
||||
signals.async_wait(
|
||||
[&](boost::system::error_code const&, int)
|
||||
|
||||
@@ -28,9 +28,9 @@ namespace test {
|
||||
class ws_echo_server
|
||||
{
|
||||
std::ostream& log_;
|
||||
boost::asio::io_context ioc_;
|
||||
boost::asio::executor_work_guard<
|
||||
boost::asio::io_context::executor_type> work_;
|
||||
net::io_context ioc_;
|
||||
net::executor_work_guard<
|
||||
net::io_context::executor_type> work_;
|
||||
multi_buffer buffer_;
|
||||
test::stream ts_;
|
||||
std::thread t_;
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
void
|
||||
async_close()
|
||||
{
|
||||
boost::asio::post(ioc_,
|
||||
net::post(ioc_,
|
||||
[&]
|
||||
{
|
||||
if(ws_.is_open())
|
||||
@@ -141,7 +141,7 @@ private:
|
||||
#if 0
|
||||
if( se.code() != error::closed &&
|
||||
se.code() != error::failed &&
|
||||
se.code() != boost::asio::error::eof)
|
||||
se.code() != net::error::eof)
|
||||
log_ << "ws_echo_server: " << se.code().message() << std::endl;
|
||||
#endif
|
||||
}
|
||||
@@ -233,7 +233,7 @@ private:
|
||||
#if 0
|
||||
if( ec != error::closed &&
|
||||
ec != error::failed &&
|
||||
ec != boost::asio::error::eof)
|
||||
ec != net::error::eof)
|
||||
log_ <<
|
||||
"echo_server_async: " <<
|
||||
ec.message() <<
|
||||
|
||||
@@ -32,11 +32,11 @@ namespace test {
|
||||
class enable_yield_to
|
||||
{
|
||||
protected:
|
||||
boost::asio::io_context ioc_;
|
||||
net::io_context ioc_;
|
||||
|
||||
private:
|
||||
boost::asio::executor_work_guard<
|
||||
boost::asio::io_context::executor_type> work_;
|
||||
net::executor_work_guard<
|
||||
net::io_context::executor_type> work_;
|
||||
std::vector<std::thread> threads_;
|
||||
std::mutex m_;
|
||||
std::condition_variable cv_;
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
public:
|
||||
/// The type of yield context passed to functions.
|
||||
using yield_context =
|
||||
boost::asio::yield_context;
|
||||
net::yield_context;
|
||||
|
||||
explicit
|
||||
enable_yield_to(std::size_t concurrency = 1)
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
}
|
||||
|
||||
/// Return the `io_context` associated with the object
|
||||
boost::asio::io_context&
|
||||
net::io_context&
|
||||
get_io_service()
|
||||
{
|
||||
return ioc_;
|
||||
@@ -120,7 +120,7 @@ void
|
||||
enable_yield_to::
|
||||
spawn(F0&& f, FN&&... fn)
|
||||
{
|
||||
boost::asio::spawn(ioc_,
|
||||
net::spawn(ioc_,
|
||||
[&](yield_context yield)
|
||||
{
|
||||
f(yield);
|
||||
|
||||
Reference in New Issue
Block a user