asio icon indicating copy to clipboard operation
asio copied to clipboard

is boost::asio supported one io_context reading, and another one writing on the same TCP connection?

Open clee01 opened this issue 7 months ago • 0 comments

like this demo

boost::asio::io_context read_io, write_io;

boost::asio::ip::tcp::socket original_socket(read_io);
// ... connect or accept

auto native_handle = original_socket.native_handle();

boost::asio::ip::tcp::socket write_socket(write_io);
write_socket.assign(boost::asio::ip::tcp::v4(), native_handle);

clee01 avatar May 14 '25 03:05 clee01