powered by Jive Software

Smack minimum ping interval

Follow up, the issue was on my end. pingFailed is being called now. However is there any technical reason why the minimum timeout is 2 minutes? We are using the pingFailed to detect when the connection has been lost and 2 minutes is an eternity in our customer’s environment. Or is there a better way to detect that a connection has been lost?

I don’t know. With these settings, it’s hard to please everyone, I guess. I do wonder why the value is hardcoded, instead of configurable.

1 Like

Configurable would be nice. A quick change would be:
final long minimumTimeout = TimeUnit.SECONDS.toMillis(pingInterval);

Create a PR and see what happens. :wink:

If you find yourself in a situation where you believe need a lower ping interval than 2 minutes, which is already very low, IMHO to low, then you may want to reconsider your whole architecture. I did not encounter an UX issue, that could only be solved by lowering the ping interval. There are better alternatives that are also more reliable. On the other hand, a low ping interval causes unnecessary load and resource usage.

While your answer is logical, I think the configurable option is still a good way.
Sometimes it’s good to give people and option to shoot in their feet, if they think it is a good thing.

Nothing prevents you from pinging the user’s server with a lower interval. But you have to code the logic for that yourself. :slight_smile:


This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.