resolveReachableHost

fun resolveReachableHost(configuredHost: String, port: Int = DEFAULT_SOCKS_PORT): String

Returns a SOCKS host that is actually reachable from this process. If configuredHost normalizes to loopback, probes the emulator alias, Waydroid bridge, and default gateway (in that order) and returns the first one accepting a TCP connection on port; falls back to the normalized loopback address if none respond.

A previously confirmed-reachable host is reused for CACHE_TTL_MS (re-verified first, before falling back to the full candidate race) to avoid transient probe flakiness causing the resolved host to change from call to call. See CACHE_TTL_MS kdoc.