Files
Sparkledns/app/src/main/java/cc/skysparkle/sparkledns/Http.kt
T
kalarina 5a1bf79e4b Derive all OkHttp clients from one shared base client
The DoH transport keeps its own connection pool and no longer creates
the dispatcher's thread pool only to shut it down.
2026-10-25 12:23:46 +02:00

15 lines
442 B
Kotlin

package cc.skysparkle.sparkledns
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
// Base for every OkHttp client in the app. Clients made with newBuilder() share its dispatcher
// and thread pools, and its connection pool unless they bring their own.
internal object Http {
val client: OkHttpClient by lazy {
OkHttpClient.Builder()
.connectTimeout(15, TimeUnit.SECONDS)
.build()
}
}