Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for callTimeout (0.19 sec)

  1. okcurl/src/main/kotlin/okhttp3/curl/Main.kt

          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) {
          val trustManager = createInsecureTrustManager()
          val sslSocketFactory = createInsecureSslSocketFactory(trustManager)
    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)
  2. samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java

        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()
            .url("http://httpbin.org/delay/2") // This URL is served with a 2 second delay.
    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)
  3. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

        assertThat(client.minWebSocketMessageToCompress).isEqualTo(1024)
      }
    
      @Test fun timeoutValidRange() {
        val builder = OkHttpClient.Builder()
        try {
          builder.callTimeout(Duration.ofNanos(1))
        } catch (ignored: IllegalArgumentException) {
        }
        try {
          builder.connectTimeout(Duration.ofNanos(1))
        } catch (ignored: IllegalArgumentException) {
        }
        try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  4. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

            .build(),
        )
        newEventSource()
        listener.assertFailure(null)
      }
    
      @Test
      fun fullCallTimeoutDoesNotApplyOnceConnected() {
        client =
          client.newBuilder()
            .callTimeout(250, TimeUnit.MILLISECONDS)
            .build()
        server.enqueue(
          MockResponse.Builder()
            .bodyDelay(500, TimeUnit.MILLISECONDS)
            .setHeader("content-type", "text/event-stream")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

         * all must complete within one timeout period.
         *
         * The default value is 0 which imposes no timeout.
         */
        fun callTimeout(
          timeout: Long,
          unit: TimeUnit,
        ) = apply {
          callTimeout = checkDuration("timeout", timeout, unit)
        }
    
        /**
         * Sets the default timeout for complete calls. A value of 0 means no timeout, otherwise values
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/kt/ConfigureTimeouts.kt

    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()
            .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)
  7. okhttp/src/test/java/okhttp3/SocketChannelTest.kt

          assumeTrue((socketMode.provider == CONSCRYPT) == platform.isConscrypt())
        }
    
        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) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Call.kt

       * body, server processing, and reading the response body. If the call requires redirects or
       * retries all must complete within one timeout period.
       *
       * Configure the client's default timeout with [OkHttpClient.Builder.callTimeout].
       */
      fun timeout(): Timeout
    
      /**
       * Create a new, identical call to this one which can be enqueued or executed even if this call
       * has already been.
       */
      public override fun clone(): Call
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt

      }
    
      @Test
      fun configureClientDefault() {
        val request =
          Request.Builder()
            .url(server.url("/"))
            .build()
        val timeoutClient =
          client.newBuilder()
            .callTimeout(Duration.ofMillis(456))
            .build()
        val call = timeoutClient.newCall(request)
        assertThat(call.timeout().timeoutNanos())
          .isEqualTo(TimeUnit.MILLISECONDS.toNanos(456))
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/FastFallbackTest.kt

          )
        serverIpv4.shutdown()
        serverIpv6.enqueue(
          MockResponse(body = "hello from IPv6"),
        )
    
        client =
          client.newBuilder()
            .fastFallback(false)
            .callTimeout(1_000, TimeUnit.MILLISECONDS)
            .build()
        val call = client.newCall(Request(url))
        assertFailsWith<IOException> {
          call.execute()
        }.also { expected ->
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.3K bytes
    - Viewed (0)
Back to top