Class NetworkConfig

  • All Implemented Interfaces:

    
    public final class NetworkConfig
    
                        

    Settings-group for the timeouts applied to every outbound HTTP call ServerPackCreator makes.

    These exist because the JDK's default is to wait forever: an HttpURLConnection with no timeouts set never gives up on a host which accepts the connection and then goes silent, which is exactly what a black-holing firewall or a stalled upstream looks like. Twelve manifest checks sit on the blocking startup path, so an unbounded wait there is a hang with no recovery rather than a slow start.

    Two timeouts are separate on purpose, because they answer different questions:

    • connect bounds reaching the host at all, and can be short — either the TCP handshake completes quickly or the host is not there.

    • read bounds how long a single read may block waiting for bytes. It is not a budget for the whole transfer, which is why a multi-megabyte download does not need a huge value — only a host that stalls mid-stream for longer than the timeout trips it.

    downloadReadTimeout is nevertheless separate from readTimeout because the two are used against different things: a metadata manifest either answers promptly or is broken, while an installer or mod jar is legitimately served by hosts that trickle bytes under load.