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

Send ping if no message received from peer for 30s #1340

Merged
merged 2 commits into from
Mar 5, 2020
Merged

Send ping if no message received from peer for 30s #1340

merged 2 commits into from
Mar 5, 2020

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Mar 4, 2020

As long as we receive messages from our peer, we consider it is
online and don't send ping requests. If we don't hear from the
peer, we send pings and expect timely answers, otherwise we'll
close the connection.

This is implemented by scheduling a ping request every 30 seconds,
and pushing it back every time we receive a message from the peer.

As long as we receive messages from our peer, we consider it is
online and don't send ping requests. If we don't hear from the
peer, we send pings and expect timely answers, otherwise we'll
close the connection.

This is implemented by scheduling a ping request every 30 seconds,
and pushing it back every time we receive a message from the peer.
@pm47 pm47 requested a review from t-bast March 4, 2020 14:59
@pm47
Copy link
Member Author

pm47 commented Mar 4, 2020

NB: I highly recommend selecting "Hide whitespace changes" for the review

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels better than the StateTimeout, I always found this hard to read (and it had a bug in it that we didn't see, so...).

@pm47 pm47 merged commit 3b5bba6 into master Mar 5, 2020
@pm47 pm47 deleted the fix-ping branch March 5, 2020 12:08
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