Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for readTimeout (0.18 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (1)
  2. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 23.2K bytes
    - Viewed (1)
  3. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  4. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  5. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 04 11:40:21 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  6. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  7. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

     */
    internal fun Socket.isHealthy(source: BufferedSource): Boolean {
      return try {
        val readTimeout = soTimeout
        try {
          soTimeout = 1
          !source.exhausted()
        } finally {
          soTimeout = readTimeout
        }
      } catch (_: SocketTimeoutException) {
        true // Read timed out; socket is good.
      } catch (_: IOException) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  9. okhttp/src/test/java/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 {
    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)
  10. okhttp/src/main/kotlin/okhttp3/internal/http/RealInterceptorChain.kt

        timeout: Int,
        unit: TimeUnit,
      ): Interceptor.Chain {
        check(exchange == null) { "Timeouts can't be adjusted in a network interceptor" }
    
        return copy(readTimeoutMillis = checkDuration("readTimeout", timeout.toLong(), unit))
      }
    
      override fun writeTimeoutMillis(): Int = writeTimeoutMillis
    
      override fun withWriteTimeout(
        timeout: Int,
        unit: TimeUnit,
      ): Interceptor.Chain {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (0)
Back to top