Re: [asio-users] Different io_service for TLS handshake and read/write
Brought to you by:
chris_kohlhoff
From: Michi H. <mic...@cr...> - 2018-11-30 05:34:46
|
Thanks for the suggestion! I'm using boost 1.58, which explains why I never noticed this function __ It looks like this functionality was added in 1.66. I'll see whether I can switch to that. Thanks again, Michi. On 30/11/18, 12:38, "Vinnie Falco" <vin...@gm...> wrote: After the handshake, submit completion handlers for subsequent operations using bind_handler with the executor of the second io_context. Example: io_context ioc1; tcp::socket sock(ioc1); ... io_context ioc2; sock.async_read_some(buffers, bind_executor(ioc2.get_executor(), [](error_code ec, std::size_t bytes_transferred) { ... } Disclaimer: untested Good luck! |