On 9/16/2020 5:59 PM, Alex Harsanyi wrote:
On Windows at least, "localhost" resolves to two IP addresses (in this
order): "::1" (IPv6) and "127.0.0.1". The Racket `tcp-connect`
function will try the fist one first, and since you probably don't
bind your web server to the IPv6 address, the connection times out,
than `tcp-connect` tries the IPv4 one and succeeds. This is why
using "localhost" is slower than using "127.0.0.1".
I know this because I have been caught by it as well :-) My solution
was to learn IpV6 and start my server on IPv6 :-)
Perhaps curl and Chrome go straight for the IPv4 address.
As a test, try starting your web server on an IPv6 address (::1) and
see if things improve.
Alex.
That's true - Windows tries IPv6 first - but it isn't the whole story
here. If IPv6 were the only cause, then disabling IPv6 should fix the
problem ... but it doesn't always fix the problem. On some Windows
machines, name resolution by the local DNS client is just painfully slow
[and no one knows exactly why].
Certainly Stephen should try either binding the server to ::1 or
disabling IPv6 altogether ... but it's possible that neither of these
options may solve his problem.
George
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/ba034951-9271-03fa-6d3d-e98879ba7792%40comcast.net.