• Matthew Holt's avatar
    core (Windows): Retry every 100ms for 2s if listener fails to bind · 4d71620c
    Matthew Holt authored
    In testing, I've found that Windows doesn't release the socket right away even though the listener is closed, so calling caddy.Start() right after caddy.Stop() can fail. This change has server.ListenAndServe() try up to 20 times every 100ms to bind the listener, and only return an error if it doesn't succeed after 2 seconds. This might be kind of nifty for Unix, too, but there hasn't been a need for it yet.
    4d71620c
server.go 13.2 KB