Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 94 for seconds (0.16 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java

            .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()
            .url("http://httpbin.org/delay/2") // This URL is served with a 2 second delay.
            .build();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Sep 28 18:00:26 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  2. okcurl/src/main/kotlin/okhttp3/curl/Main.kt

        "--connect-timeout",
        help = "Maximum time allowed for connection (seconds)",
      ).int().default(DEFAULT_TIMEOUT)
    
      val readTimeout: Int by option("--read-timeout", help = "Maximum time allowed for reading data (seconds)").int().default(DEFAULT_TIMEOUT)
    
      val callTimeout: Int by option(
        "--call-timeout",
        help = "Maximum time allowed for the entire call (seconds)",
      ).int().default(DEFAULT_TIMEOUT)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (1)
  3. okhttp-tls/src/test/java/okhttp3/tls/HeldCertificateTest.kt

          .isCloseTo(now.toDouble(), deltaMillis)
        assertThat(certificate.notAfter.time.toDouble())
          .isCloseTo(now.toDouble() + durationMillis, deltaMillis)
      }
    
      @Test
      fun customInterval() {
        // 5 seconds starting on 1970-01-01.
        val heldCertificate =
          HeldCertificate.Builder()
            .validityInterval(5000L, 10000L)
            .build()
        val certificate = heldCertificate.certificate
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 22.5K bytes
    - Viewed (0)
  4. mockwebserver/README.md

        .setBody("{}");
    ```
    
    MockResponse can be used to simulate a slow network. This is useful for
    testing timeouts and interactive testing.
    
    ```java
    response.throttleBody(1024, 1, TimeUnit.SECONDS);
    ```
    
    
    #### RecordedRequest
    
    Verify requests by their method, path, HTTP version, body, and headers.
    
    ```java
    RecordedRequest request = server.takeRequest();
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  5. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

        assertThat(Adapters.parseGeneralizedTime("19920622123421Z"))
          .isEqualTo(date("1992-06-22T12:34:21.000+0000").time)
      }
    
      @Disabled("fractional seconds are not implemented")
      @Test
      fun `parse generalized time with fractional seconds`() {
        assertThat(Adapters.parseGeneralizedTime("19920722132100.3Z"))
          .isEqualTo(date("1992-07-22T13:21:00.300+0000").time)
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

          " cipherSuite=${handshake?.cipherSuite ?: "none"}" +
          " protocol=$protocol}"
      }
    
      companion object {
        const val IDLE_CONNECTION_HEALTHY_NS = 10_000_000_000 // 10 seconds.
    
        fun newTestConnection(
          taskRunner: TaskRunner,
          connectionPool: RealConnectionPool,
          route: Route,
          socket: Socket,
          idleAtNs: Long,
        ): RealConnection {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/ConfigureTimeouts.kt

        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()
            .url("http://httpbin.org/delay/2") // This URL is served with a 2 second delay.
            .build()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  8. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

      @Test
      fun timeoutCall() {
        runTest {
          server.enqueue(
            MockResponse.Builder()
              .bodyDelay(5, TimeUnit.SECONDS)
              .body("abc")
              .build(),
          )
    
          val call = client.newCall(request)
    
          try {
            withTimeout(1.seconds) {
              call.executeAsync().use {
                withContext(Dispatchers.IO) {
                  it.body.string()
                }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/AutobahnTester.kt

              t: Throwable,
              response: Response?,
            ) {
              t.printStackTrace(System.out)
              latch.countDown()
            }
          },
        )
    
        check(latch.await(30, TimeUnit.SECONDS)) { "Timed out waiting for test $number to finish." }
        val endNanos = System.nanoTime()
        val tookMs = TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos.get())
        println("Took ${tookMs}ms")
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheStrategy.kt

          if (requestCaching.maxAgeSeconds != -1) {
            freshMillis = minOf(freshMillis, SECONDS.toMillis(requestCaching.maxAgeSeconds.toLong()))
          }
    
          var minFreshMillis: Long = 0
          if (requestCaching.minFreshSeconds != -1) {
            minFreshMillis = SECONDS.toMillis(requestCaching.minFreshSeconds.toLong())
          }
    
          var maxStaleMillis: Long = 0
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12K bytes
    - Viewed (0)
Back to top