mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
The DoH transport keeps its own connection pool and no longer creates the dispatcher's thread pool only to shut it down.
15 lines
442 B
Kotlin
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()
|
|
}
|
|
}
|