forked from boostorg/beast
@@ -237,7 +237,15 @@ private:
|
|||||||
|
|
||||||
op_state read;
|
op_state read;
|
||||||
op_state write;
|
op_state write;
|
||||||
net::steady_timer timer; // rate timer
|
#if 0
|
||||||
|
net::basic_waitable_timer<
|
||||||
|
std::chrono::steady_clock,
|
||||||
|
net::wait_traits<
|
||||||
|
std::chrono::steady_clock>,
|
||||||
|
Executor> timer; // rate timer;
|
||||||
|
#else
|
||||||
|
net::steady_timer timer;
|
||||||
|
#endif
|
||||||
int waiting = 0;
|
int waiting = 0;
|
||||||
|
|
||||||
impl_type(impl_type&&) = default;
|
impl_type(impl_type&&) = default;
|
||||||
|
@@ -1259,6 +1259,44 @@ public:
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void
|
||||||
|
testIssue1589()
|
||||||
|
{
|
||||||
|
net::io_context ioc;
|
||||||
|
|
||||||
|
// the timer needlessly used polymorphic executor
|
||||||
|
basic_stream<
|
||||||
|
net::ip::tcp,
|
||||||
|
net::io_context::executor_type>{ioc};
|
||||||
|
|
||||||
|
// make sure strands work
|
||||||
|
basic_stream<
|
||||||
|
net::ip::tcp,
|
||||||
|
net::strand<
|
||||||
|
net::io_context::executor_type>>{
|
||||||
|
net::make_strand(ioc)};
|
||||||
|
|
||||||
|
// address the problem in the issue
|
||||||
|
{
|
||||||
|
net::basic_stream_socket<
|
||||||
|
net::ip::tcp,
|
||||||
|
net::strand<
|
||||||
|
net::io_context::executor_type>
|
||||||
|
> sock(net::make_strand(ioc));
|
||||||
|
basic_stream<
|
||||||
|
net::ip::tcp,
|
||||||
|
net::strand<
|
||||||
|
net::io_context::executor_type>,
|
||||||
|
unlimited_rate_policy> stream(std::move(sock));
|
||||||
|
BOOST_STATIC_ASSERT(
|
||||||
|
std::is_convertible<
|
||||||
|
decltype(sock)::executor_type,
|
||||||
|
decltype(stream)::executor_type>::value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
void
|
void
|
||||||
run()
|
run()
|
||||||
{
|
{
|
||||||
@@ -1268,6 +1306,7 @@ public:
|
|||||||
testConnect();
|
testConnect();
|
||||||
testMembers();
|
testMembers();
|
||||||
testJavadocs();
|
testJavadocs();
|
||||||
|
testIssue1589();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user