boost
boost copied to clipboard
How to achieve data read timeout on local::stream_protocol::socket
Basically i am using async_wait with wait_read flag to read data on socket when socket is ready for read. but this async_wait waits forever with wait_read flag if there is no data on socket. i wanted to have a timeout for this async_wait operation on local::stream_protocol::socket
stream_protocol::socket unixSocket;
this->unixSocket.async_wait(
stream_protocol::socket::wait_read,
[this, self(shared_from_this())](boost::system::error_code ec) {
if (ec)
{
this->connection->close();
return;
}
doReadDataOnSocket();
}