Skip to content

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

@ricardocrl

Description

@ricardocrl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions