MCPcopy Create free account
hub / github.com/boostorg/asio / buffered_executor_send

Function buffered_executor_send

test/experimental/channel.cpp:635–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633}
634
635void buffered_executor_send()
636{
637 io_context ctx;
638 io_context ctx2;
639
640 channel<void(boost::system::error_code, std::string)> ch1(ctx, 1);
641
642 boost::system::error_code ec1 = boost::asio::error::would_block;
643 std::string s1 = "0123456789";
644 ch1.async_send(boost::asio::error::eof, std::move(s1),
645 bind_executor(ctx2,
646 [&](boost::system::error_code ec)
647 {
648 ec1 = ec;
649 }));
650
651 BOOST_ASIO_CHECK(ec1 == boost::asio::error::would_block);
652
653 ctx.run();
654
655 BOOST_ASIO_CHECK(ec1 == boost::asio::error::would_block);
656
657 ctx2.run();
658
659 BOOST_ASIO_CHECK(!ec1);
660}
661
662void try_send_via_dispatch()
663{

Callers

nothing calls this directly

Calls 2

async_sendMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected