Skip to content
New issue

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

LibBoostAsioHandler does not detect connection timeouts when heartbeat is negotiated #464

Open
ricardocrl opened this issue May 31, 2022 · 0 comments

Comments

@ricardocrl
Copy link

Opposed to libev integration, libboostasio.h does not implement any mechanism to detect connection drops.

At first, I tried using TcpHandler::onHeartbeat() to detect timeouts, but this is not sufficient because the broker does not send heartbeats if there is data flowing to us. Intercepting these events on top of boost::asio integration is not trivial or beauty.

When comparing to libev.h, this is solved with onActive being called and extending the timeout timer. So I decided to fix this by porting the solution into libboostasio.h, hooking the timer update in the most equivalent method read_handler. This is the PR for the changes proposed: #463.

On a separate note, I believe this code can still be refactored for a better integration with boost. I'm not fluent with boost or boost::asio, but I may suggest some changes with care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant