boostorg / boostorg/boost

How to achieve data read timeout on local::stream_protocol::socket

未关闭
#443 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
HTML
星标
8.6k
派生
1.9k
平均合并
39 分钟
30 天内合并 PR
2

描述

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();
}

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。