Boost logo

Boost :

From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2021-11-28 16:47:06


Am So., 28. Nov. 2021 um 16:36 Uhr schrieb Peter Dimov via Boost <
boost_at_[hidden]>:

>
> The documentation of spawn_fiber often says
> "must have signature void(basic_yield_context<Handler>)"
> on signatures where there's no Handler.
>

void do_echo(boost::spawn::yield_context yield) {
    try {
        char data[128];
        for (;;) {
            std::size_t length =
my_socket.async_read_some(boost::asio::buffer(data), yield);
            boost::asio::async_write(my_socket,
boost::asio::buffer(data, length), yield);
        }
    } catch (std::exception const& e) {
        // ...
    }}boost::spawn_fiber(my_strand, do_echo);

do_echo() is the handler that is passed to spawn_fiber()


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk