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:
@@ -65,7 +65,7 @@ public:
|
||||
catch(system_error const& se)
|
||||
{
|
||||
BEAST_EXPECTS(
|
||||
se.code() == boost::asio::error::operation_aborted,
|
||||
se.code() == net::error::operation_aborted,
|
||||
se.code().message());
|
||||
}
|
||||
}
|
||||
@@ -171,13 +171,13 @@ public:
|
||||
void
|
||||
testSuspend()
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using net::buffer;
|
||||
|
||||
// suspend on ping
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
ws.async_close({},
|
||||
[&](error_code ec)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
BEAST_EXPECT(++count == 2);
|
||||
@@ -324,7 +324,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
ws.async_close({},
|
||||
[&](error_code ec)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
BEAST_EXPECT(++count == 2);
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
ws.async_read(b,
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
BEAST_EXPECT(++count == 3);
|
||||
@@ -409,7 +409,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
ws.async_read(b,
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
BEAST_EXPECT(++count == 3);
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -474,7 +474,7 @@ public:
|
||||
ws.async_read(b,
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
++count;
|
||||
@@ -482,7 +482,7 @@ public:
|
||||
ws.async_write(buffer(s),
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
++count;
|
||||
@@ -490,7 +490,7 @@ public:
|
||||
ws.async_ping({},
|
||||
[&](error_code ec)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
++count;
|
||||
@@ -504,7 +504,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -514,7 +514,7 @@ public:
|
||||
ws.async_read(b,
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec && ec != boost::asio::error::operation_aborted)
|
||||
if(ec && ec != net::error::operation_aborted)
|
||||
{
|
||||
BEAST_EXPECTS(ec, ec.message());
|
||||
BOOST_THROW_EXCEPTION(
|
||||
@@ -525,7 +525,7 @@ public:
|
||||
++count;
|
||||
if(count == 4)
|
||||
BEAST_EXPECT(
|
||||
ec == boost::asio::error::operation_aborted);
|
||||
ec == net::error::operation_aborted);
|
||||
});
|
||||
ws.async_write(buffer(s),
|
||||
[&](error_code ec, std::size_t n)
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
ws.async_ping({},
|
||||
[&](error_code ec)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
{
|
||||
BEAST_EXPECTS(ec, ec.message());
|
||||
BOOST_THROW_EXCEPTION(
|
||||
@@ -565,7 +565,7 @@ public:
|
||||
doFailLoop([&](test::fail_count& fc)
|
||||
{
|
||||
echo_server es{log};
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc, fc};
|
||||
ws.next_layer().connect(es.stream());
|
||||
ws.handshake("localhost", "/");
|
||||
@@ -583,7 +583,7 @@ public:
|
||||
ws.async_read(b,
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
++count;
|
||||
@@ -591,7 +591,7 @@ public:
|
||||
ws.async_write(buffer(s),
|
||||
[&](error_code ec, std::size_t)
|
||||
{
|
||||
if(ec != boost::asio::error::operation_aborted)
|
||||
if(ec != net::error::operation_aborted)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
system_error{ec});
|
||||
++count;
|
||||
@@ -621,14 +621,14 @@ public:
|
||||
stream<test::stream> ws{ioc_};
|
||||
stream<test::stream>::close_op<handler> op{
|
||||
handler{}, ws, {}};
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
asio_handler_is_continuation(&op);
|
||||
}
|
||||
|
||||
void
|
||||
testMoveOnly()
|
||||
{
|
||||
boost::asio::io_context ioc;
|
||||
net::io_context ioc;
|
||||
stream<test::stream> ws{ioc};
|
||||
ws.async_close({}, move_only_handler{});
|
||||
}
|
||||
@@ -648,12 +648,12 @@ public:
|
||||
// make sure things compile, also can set a
|
||||
// breakpoint in asio_handler_invoke to make sure
|
||||
// it is instantiated.
|
||||
boost::asio::io_context ioc;
|
||||
boost::asio::strand<
|
||||
boost::asio::io_context::executor_type> s(
|
||||
net::io_context ioc;
|
||||
net::strand<
|
||||
net::io_context::executor_type> s(
|
||||
ioc.get_executor());
|
||||
stream<test::stream> ws{ioc};
|
||||
ws.async_close({}, boost::asio::bind_executor(
|
||||
ws.async_close({}, net::bind_executor(
|
||||
s, copyable_handler{}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user