make_strand is in net::

This commit is contained in:
Vinnie Falco committed 2019-03-02 07:33:57 -08:00
1 parent dfd3752c23
commit fca4b3ae10
32 files changed
+58 -121

No files matched your search

-1
View File
@@ -57,7 +57,6 @@ add_executable (tests-beast-core
flat_stream.cpp
handler_ptr.cpp
make_printable.cpp
make_strand.cpp
multi_buffer.cpp
ostream.cpp
rate_policy.cpp
-1
View File
@@ -45,7 +45,6 @@ local SOURCES =
flat_stream.cpp
handler_ptr.cpp
make_printable.cpp
make_strand.cpp
multi_buffer.cpp
ostream.cpp
rate_policy.cpp
+1 -2
View File
@@ -8,7 +8,6 @@
//
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/make_strand.hpp>
#include <boost/beast/core/detail/get_io_context.hpp>
#include <boost/beast/_experimental/unit_test/suite.hpp>
#include <boost/asio/strand.hpp>
@@ -32,7 +31,7 @@ public:
BEAST_EXPECT(get_io_context(none{}) == nullptr);
BEAST_EXPECT(get_io_context(ioc) == &ioc);
BEAST_EXPECT(get_io_context(ioc.get_executor()) == &ioc);
BEAST_EXPECT(get_io_context(make_strand(ioc)) == &ioc);
BEAST_EXPECT(get_io_context(net::make_strand(ioc)) == &ioc);
BEAST_EXPECT(get_io_context(net::executor(ioc.get_executor())) == &ioc);
#if 0
// VFALCO FIXME
+7 -7
View File
@@ -8,7 +8,7 @@
//
// Test that header file is self-contained.
#include <boost/beast/core/make_strand.hpp>
#include <boost/beast/core/net::make_strand.hpp>
#include <boost/beast/_experimental/unit_test/suite.hpp>
#include <boost/asio/executor.hpp>
@@ -24,15 +24,15 @@ public:
testFunction()
{
net::io_context ioc;
make_strand(ioc);
make_strand(ioc.get_executor());
make_strand(make_strand(ioc));
net::make_strand(ioc);
net::make_strand(ioc.get_executor());
net::make_strand(net::make_strand(ioc));
net::executor ex(ioc.get_executor());
make_strand(ex);
net::make_strand(ex);
// this *should-not* compile
//make_strand(ex.context());
//net::make_strand(ex.context());
}
void
@@ -43,7 +43,7 @@ public:
}
};
BEAST_DEFINE_TESTSUITE(beast,core,make_strand);
BEAST_DEFINE_TESTSUITE(beast,core,net::make_strand);
} // beast
} // boost
+1 -2
View File
@@ -10,7 +10,6 @@
// Test that header file is self-contained.
#include <boost/beast/websocket/stream.hpp>
#include <boost/beast/core/make_strand.hpp>
#include <boost/beast/core/tcp_stream.hpp>
#include <boost/asio/strand.hpp>
@@ -158,7 +157,7 @@ public:
{
net::io_context ioc;
{
websocket::stream<tcp_stream> ws{make_strand(ioc)};
websocket::stream<tcp_stream> ws{net::make_strand(ioc)};
}
{
websocket::stream<tcp_stream> ws(ioc);
+3 -3
View File
@@ -69,7 +69,7 @@ core_3_timeouts_snippets()
//[code_core_3_timeouts_3
// The strand will be used to invoke all completion handlers
tcp_stream stream(make_strand(ioc));
tcp_stream stream(net::make_strand(ioc));
//]
@@ -111,7 +111,7 @@ core_3_timeouts_snippets()
// We construct the acceptor to use a new strand, and listen
// on the loopback address with an operating-system assigned port.
net::ip::tcp::acceptor acceptor(make_strand(ioc));
net::ip::tcp::acceptor acceptor(net::make_strand(ioc));
acceptor.bind(net::ip::tcp::endpoint(net::ip::make_address_v4("127.0.0.1"), 0));
acceptor.listen(0);
@@ -120,7 +120,7 @@ core_3_timeouts_snippets()
// connected to the peer. The socket will have its own executor,
// which in the call below is a new strand for the I/O context.
net::ip::tcp::socket s = acceptor.accept(make_strand(ioc));
net::ip::tcp::socket s = acceptor.accept(net::make_strand(ioc));
// Construct a new tcp_stream from the connected socket.
// The stream will use the strand created when the connection
+2 -2
View File
@@ -47,7 +47,7 @@ snippets()
// The `tcp_stream` will be constructed with a new
// strand which uses the specified I/O context.
stream<tcp_stream> ws(make_strand(ioc));
stream<tcp_stream> ws(net::make_strand(ioc));
//]
}
@@ -76,7 +76,7 @@ snippets()
//[code_websocket_5f
// The WebSocket stream will use SSL and a new strand
stream<ssl_stream<tcp_stream>> wss(make_strand(ioc), ctx);
stream<ssl_stream<tcp_stream>> wss(net::make_strand(ioc), ctx);
//]
+1 -1
View File
@@ -58,7 +58,7 @@ snippets()
//[code_websocket_1_3
// The stream will use the strand for invoking all completion handlers
stream<tcp_stream> ws(make_strand(ioc));
stream<tcp_stream> ws(net::make_strand(ioc));
// This overload of accept uses the socket provided for the new connection.
// The function `tcp_stream::socket` provides access to the low-level socket