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

Add support for passive connection lost checking #1290

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

robert-s-ubi
Copy link
Contributor

Description

When both ends of a WebSocket connection need to know when the connection is lost, both sending pings is redundant, as a received ping already indicates that the peer is still connected.

Add an optional boolean parameter to the setConnectionLostTimeout() method, which when set to true makes the connection lost checking passive, i.e. the check never sends out pings, but only checks whether an incoming ping was received recently enough.

For passive connection lost checking, the peer must be known to do active connection lost checking with a timeout equal (or lower) than the one locally used.

How Has This Been Tested?

We have included this change in our backend software and it works as desired.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

robert-s-ubi and others added 4 commits November 1, 2022 15:18
When both ends of a WebSocket connection need to know when the
connection is lost, both sending pings is redundant, as a received ping
already indicates that the peer is still connected.

Add an optional boolean parameter to the setConnectionLostTimeout()
method, which when set to true makes the connection lost cheking
passive, i.e. the check never sends out pings, but only checks whether
an incoming ping was received recently enough.

For passive connection lost checking, the peer must be known to do
active connection lost checking with a timeout equal (or lower) than the
one locally used.
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

Successfully merging this pull request may close these issues.

2 participants