Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for readTimeout (0.19 sec)

  1. 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) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 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/kt/PerCallSettings.kt

            .url("http://httpbin.org/delay/1") // This URL is served with a 1 second delay.
            .build()
    
        // Copy to customize OkHttp for this request.
        val client1 =
          client.newBuilder()
            .readTimeout(500, TimeUnit.MILLISECONDS)
            .build()
        try {
          client1.newCall(request).execute().use { response ->
            println("Response 1 succeeded: $response")
          }
        } catch (e: IOException) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  3. okhttp/src/main/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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 23.2K bytes
    - Viewed (1)
  4. 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) {
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.9K bytes
    - Viewed (0)
  5. 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()
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Sep 28 18:00:26 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  6. okhttp/src/main/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
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  7. 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);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 04 11:40:21 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/DuplexTest.kt

          Request.Builder()
            .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 ->
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  9. 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  10. 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
Back to top