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
Adds a periodic check that triggers a disconnect if a half-open connection is detected. #160
Conversation
…ction is detected.
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
============================================
- Coverage 20.26% 19.94% -0.33%
Complexity 82 82
============================================
Files 30 30
Lines 1120 1138 +18
Branches 106 109 +3
============================================
Hits 227 227
- Misses 873 891 +18
Partials 20 20
Continue to review full report at Codecov.
|
Why is a separate timer necessary, doesn't PingManager fire |
@bgrozev that was my first thought, as well as Damyan's but, perhaps because the ping has not been sent, the answer is no. In other words, it's not necessarily the ping reply that's hung, in the particular case I was looking at it was the disco info which is of |
if (nowMs - lastStanzaReceivedMs > 2 * 1000 * DEFAULT_PING_INTERVAL_SECONDS) | ||
{ | ||
logger.warn("Half-open XMPP connection detected, will trigger a disconnect."); | ||
con.disconnect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you trigger the disconnect, it reconnects again, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please fix the styling of the opening braces?
And maybe introduce a constant for 2*1000*DEFAULT_PING_INTERVAL_SECONDS
Thanks
No description provided.