You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 methodread_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.
The text was updated successfully, but these errors were encountered: