We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, 我是第一次使用 libp2p, 在测试 rendezvous_chat 时, FindProviders 总是获取不到 Provider.
所以我修改了日志级别为Debug, 发现 src/protocol/kademlia/impl/session.cpp 中的 Session::onMessageWritten 函数, 在写完业务数据包后, 立即尝试调用 close(), 导致 Client 认为链接被重置.
请评估是否可以按如下方法进行修改?
void Session::onMessageWritten( outcome::result<size_t> res, const std::shared_ptr<ResponseHandler> &response_handler) { if (not res) { close(res.as_failure()); return; } --writing_; if (not response_handlers_.empty()) { read(); } // if (canBeClosed()) { // close(); // } }
The text was updated successfully, but these errors were encountered:
我想了一下, 这样修改可能会导致连接不能及时断开. 这种问题的出现, 有以下几种可能: 1, 帧发生了乱序, 导致提前处理了FIN; //这种低级错误不至于现在才发现 2, 处理数据帧的使用了异步方法, 导致数据帧处理滞后; //这种处理是常规操作 3, 流状态处理存在问题. //大概率是这里的问题
所以我继续看了一下代码, 发现 YamuxStream::onFINReceived() 函数中, 接收到 FIN, 立刻将 is_readable_ 置为 false. 此时, 如果数据帧和FIN帧到达的时间间隔太小, 便会出现此问题.
Sorry, something went wrong.
No branches or pull requests
Hi, 我是第一次使用 libp2p, 在测试 rendezvous_chat 时, FindProviders 总是获取不到 Provider.
所以我修改了日志级别为Debug, 发现 src/protocol/kademlia/impl/session.cpp 中的 Session::onMessageWritten 函数, 在写完业务数据包后, 立即尝试调用 close(), 导致 Client 认为链接被重置.
请评估是否可以按如下方法进行修改?
The text was updated successfully, but these errors were encountered: