31 Jan
2024
31 Jan
'24
8:37 p.m.
On Thu, Jan 18, 2024, at 7:18 PM, Dominique Devienne via Boost wrote:
Hi,
I'm trying to use ASIO to wait until a socket is ready to read, or timeout. This is a blocking wait. But the socket is not "owned" by ASIO, but is from the libpq PostgreSQL connection. So ASIO should NOT consume any of the input on the socket, just notify me when that socket is "read-ready".
I've cobbled together the following test code:
``` ... boost::asio::ip::tcp::socket io_sock(io_ctx); io_sock.assign(boost::asio::ip::tcp::v4(), socket2);
You `assign()`ed the fd, but never `release()` it, so the socket desctructor closed it.