- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 32 for readTimeouts (0.05 sec)
-
samples/guide/src/main/java/okhttp3/recipes/kt/ConfigureTimeouts.kt
import okhttp3.Request class ConfigureTimeouts { private val client: OkHttpClient = OkHttpClient .Builder() .connectTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) .callTimeout(10, TimeUnit.SECONDS) .build() fun run() { val request = Request .Builder()Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 1.3K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/-UtilJvm.kt
* @param source the source used to read bytes from the socket. */ internal fun Socket.isHealthy(source: BufferedSource): Boolean = try { val readTimeout = soTimeout try { soTimeout = 1 !source.exhausted() } finally { soTimeout = readTimeout } } catch (_: SocketTimeoutException) { true // Read timed out; socket is good. } catch (_: IOException) {
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Jul 31 04:18:40 UTC 2025 - 10.2K bytes - Viewed (1) -
okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt
.url(server.url("/")) .post(DelayedRequestBody("hello".toRequestBody(null), 1500, TimeUnit.MILLISECONDS)) .build() client = client .newBuilder() .readTimeout(1000, TimeUnit.MILLISECONDS) .build() val call = client.newCall(request) assertFailsWith<IOException> { call.execute() }.also { expected ->
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Nov 04 19:13:52 UTC 2025 - 25.8K bytes - Viewed (0) -
mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt
) server.enqueue( MockResponse .Builder() .body("DEF") .build(), ) val urlConnection = server.url("/").toUrl().openConnection() urlConnection!!.readTimeout = 1000 val inputStream = urlConnection.getInputStream() assertThat(inputStream!!.read()).isEqualTo('A'.code) assertThat(inputStream.read()).isEqualTo('B'.code)Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sun Aug 03 22:38:00 UTC 2025 - 28K bytes - Viewed (0) -
docs/recipes.md
=== ":material-language-kotlin: Kotlin" ```kotlin private val client: OkHttpClient = OkHttpClient.Builder() .connectTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) .callTimeout(10, TimeUnit.SECONDS) .build() fun run() { val request = Request.Builder()
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sat Aug 30 17:01:12 UTC 2025 - 47.8K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketHttpTest.kt
private val serverListener = WebSocketRecorder("server") private val random = Random(0) private var client = clientTestRule .newClientBuilder() .writeTimeout(Duration.ofMillis(500)) .readTimeout(Duration.ofMillis(500)) .addInterceptor( Interceptor { chain: Interceptor.Chain -> val response = chain.proceed(chain.request()) // Ensure application interceptors never see a null body.
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Nov 04 19:13:52 UTC 2025 - 35.5K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http/RealInterceptorChain.kt
timeout: Int, unit: TimeUnit, ): Interceptor.Chain { check(exchange == null) { "Timeouts can't be adjusted in a network interceptor" } return copy(readTimeoutMillis = checkDuration("readTimeout", timeout.toLong(), unit)) } override fun writeTimeoutMillis(): Int = writeTimeoutMillis override fun withWriteTimeout( timeout: Int, unit: TimeUnit, ): Interceptor.Chain {Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Fri Dec 27 13:39:56 UTC 2024 - 4.2K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/SocketChannelTest.kt
val client = clientTestRule .newClientBuilder() .dns { listOf(InetAddress.getByName("localhost")) } .callTimeout(4, SECONDS) .writeTimeout(2, SECONDS) .readTimeout(2, SECONDS) .apply { if (socketMode is TlsInstance) { if (socketMode.socketMode == Channel) { socketFactory(ChannelSocketFactory()) }Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sat Nov 01 12:18:11 UTC 2025 - 7.9K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/HttpOverHttp2Test.kt
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sat Nov 01 12:18:11 UTC 2025 - 67.4K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/ConnectionListenerTest.kt
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Nov 04 18:33:48 UTC 2025 - 9.7K bytes - Viewed (0)