summaryrefslogtreecommitdiff
path: root/src/newgrf_text.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-06 23:13:35 +0200
committerGitHub <noreply@github.com>2021-05-06 23:13:35 +0200
commitf7e390bdc084a20462fe833373087fd9106c5972 (patch)
tree26122beb7a783b37132bbe60ba13966ac87843b1 /src/newgrf_text.h
parentf1dfa661a1898cde06a38ab4cb230c95912b245b (diff)
downloadopenttd-f7e390bdc084a20462fe833373087fd9106c5972.tar.xz
Feature: use Happy Eyeballs to make network connections (TCP-only) (#9199)
Hostnames like "content.openttd.org" resolve into multiple IPv4 and IPv6. It is possible that either of the IPs is not working, either due to a poorly configured OS (having IPv6 but no valid route), broken network paths, or a service that is temporary unavailable. Instead of trying the IPs one by one, waiting for a 3s timeout between each, be a bit more like browsers, and stack attempts on top of each other with slight delays. This is called Happy Eyebells. Initially, try the first IPv6 address. If within 250ms there is no connection yet, try the first IPv4 address. 250ms later, try the second IPv6 address, etc, till all addresses are tried. If any connection is created, abort all the other (pending) connections and use the one that is created. If all fail 3s after the last connect(), trigger a timeout for all.
Diffstat (limited to 'src/newgrf_text.h')
0 files changed, 0 insertions, 0 deletions