Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for readTimeout (0.05 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

        // First request: time out after 1s.
        client =
          client
            .newBuilder()
            .readTimeout(Duration.ofSeconds(1))
            .build()
        executeSynchronously("/a").assertBody("abc")
    
        // Second request: time out after 250ms.
        client =
          client
            .newBuilder()
            .readTimeout(Duration.ofMillis(250))
            .build()
        val request = Request.Builder().url(server.url("/b")).build()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 146.6K bytes
    - Viewed (0)
  2. 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)
Back to top