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

Fix: conclude server-probe earlier if all results are in #48

Merged
merged 1 commit into from Aug 23, 2021

Conversation

TrueBrain
Copy link
Member

Additionally, change the direct-ip-detection timeout to three
seconds instead of one, to give servers more time to respond.

Before this PR, server-probe always took 2-seconds, no matter what type of server you had. But we had enough information to conclude a lot earlier in many situations.

Additionally, we only wait 1 seconds for direct-ip-detection to conclude, which is rather tight. OpenTTD itself gives connections 3 seconds, so we should do the same.

In result, with this PR:

  • Direct-ip servers get a conclusion within a second
  • STUN servers have to wait ~3 seconds (wait for the STUN result + 3 seconds for the direct-ip-detection to time out)
  • If STUN fails, it continues as soon as the above two conclude

As fallback, in case we have a bug or what-ever in the above, after 7 seconds it concludes no matter what. This really is just a safe-guard.

Additionally, change the direct-ip-detection timeout to three
seconds instead of one, to give servers more time to respond.
@TrueBrain TrueBrain merged commit 10644c9 into OpenTTD:main Aug 23, 2021
@TrueBrain TrueBrain deleted the server-probe branch August 23, 2021 09:12
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.

None yet

1 participant