threefoldtech / rmb-rs

RMB implementation in rust
Apache License 2.0
3 stars 1 forks source link

move pong handler to a lower level #135

Closed muhamadazmy closed 1 year ago

muhamadazmy commented 1 year ago

This PR does not change much, it was done during part of the investigation running for issue https://github.com/threefoldtech/rmb-rs/issues/133

The issue should not have happened because I have implemented a keep alive mechanism that allows the peer to detect connection loss (in max 40 seconds) of no pong messages received.

The PR improves the code by handling the received pong message at a lower level, the changes should not have change on the behavior but looks and acts cleaner since the ping/pong now are running at the same level.

I have tested the keepalive mechanism and i couldn't reproduce the issue, the system was able to detect the connection loss and the ability to reconnect once connection is lost

Fixes #133