28 Nov
2021
28 Nov
'21
4:47 p.m.
Am So., 28. Nov. 2021 um 16:36 Uhr schrieb Peter Dimov via Boost < boost@lists.boost.org>:
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()