Use async_initiate

This commit is contained in:
Vinnie Falco
2019-02-21 06:39:35 -08:00
parent e2d3f741b8
commit d08cc82e15
26 changed files with 1216 additions and 590 deletions
+4 -21
View File
@@ -211,33 +211,16 @@ public:
}
};
void
testAsioHandlerInvoke()
{
// make sure things compile, also can set a
// breakpoint in asio_handler_invoke to make sure
// it is instantiated.
net::io_context ioc;
net::strand<
net::io_context::executor_type> s(
ioc.get_executor());
test::stream ts{ioc};
buffered_read_stream<
test::stream&, multi_buffer> brs(ts);
brs.async_read_some(net::mutable_buffer{},
net::bind_executor(
s, copyable_handler{}));
}
void run() override
{
testSpecialMembers();
yield_to([&](yield_context yield){
testRead(yield);});
yield_to([&](yield_context yield)
{
testRead(yield);
});
testAsyncLoop();
testAsioHandlerInvoke();
}
};