- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 28 for readTimeouts (0.05 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt
), ) assertThat(response.code).isEqualTo(200) assertContent("Body", response) response.close() assertThat(server.requestCount).isEqualTo(2) } @Test fun readTimeouts() { // This relies on the fact that MockWebServer doesn't close the // connection after a response has been sent. This causes the client to // try to read more bytes than are sent, which results in a timeout.
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jun 21 20:36:35 UTC 2025 - 133.2K bytes - Viewed (0) -
okcurl/src/main/kotlin/okhttp3/curl/Main.kt
builder.followSslRedirects(followRedirects) if (connectTimeout != DEFAULT_TIMEOUT) { builder.connectTimeout(connectTimeout.toLong(), SECONDS) } if (readTimeout != DEFAULT_TIMEOUT) { builder.readTimeout(readTimeout.toLong(), SECONDS) } if (callTimeout != DEFAULT_TIMEOUT) { builder.callTimeout(callTimeout.toLong(), SECONDS) } if (allowInsecure) {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 6K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/http2/Http2Stream.kt
val doReadTimeout = callerIsIdle || doReadTimeout() if (doReadTimeout) { readTimeout.enter() } try { waitForIo() } finally { if (doReadTimeout) { readTimeout.exitAndThrowIfTimedOut() } } } if (headersQueue.isNotEmpty()) { return headersQueue.removeFirst()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon Jul 07 18:57:05 UTC 2025 - 22.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/PerCallSettings.kt
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 1.7K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/PerCallSettings.java
.url("http://httpbin.org/delay/1") // This URL is served with a 1 second delay. .build(); // Copy to customize OkHttp for this request. OkHttpClient client1 = client.newBuilder() .readTimeout(500, TimeUnit.MILLISECONDS) .build(); try (Response response = client1.newCall(request).execute()) { System.out.println("Response 1 succeeded: " + response); } catch (IOException e) {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sun May 22 01:29:42 UTC 2016 - 1.9K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java
public ConfigureTimeouts() throws Exception { client = new OkHttpClient.Builder() .connectTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) .callTimeout(10, TimeUnit.SECONDS) .build(); } public void run() throws Exception { Request request = new Request.Builder()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Sep 28 18:00:26 UTC 2019 - 1.5K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/OkHttpClientTest.kt
} catch (ignored: IllegalArgumentException) { } try { builder.writeTimeout(Duration.ofNanos(1)) } catch (ignored: IllegalArgumentException) { } try { builder.readTimeout(Duration.ofNanos(1)) } catch (ignored: IllegalArgumentException) { } try { builder.callTimeout(Duration.ofDays(365)) } catch (ignored: IllegalArgumentException) { } try {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Jun 18 12:28:21 UTC 2025 - 13.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java
import okhttp3.WebSocketListener; import okio.ByteString; public final class WebSocketEcho extends WebSocketListener { private void run() { OkHttpClient client = new OkHttpClient.Builder() .readTimeout(0, TimeUnit.MILLISECONDS) .build(); Request request = new Request.Builder() .url("ws://echo.websocket.org") .build(); client.newWebSocket(request, this);
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Apr 04 11:40:21 UTC 2024 - 1.6K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/OkHttpClient.kt
* including on [Source] of the [Response]. The default value is 10 seconds. * * @see Socket.setSoTimeout * @see Source.timeout */ fun readTimeout( timeout: Long, unit: TimeUnit, ) = apply { readTimeout = checkDuration("timeout", timeout, unit) } /** * Sets the default read timeout for new connections. A value of 0 means no timeout, otherwise
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon May 05 16:01:00 UTC 2025 - 51.7K 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 Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Jul 31 04:18:40 UTC 2025 - 10.2K bytes - Viewed (0)