Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for connectTimeout (0.19 sec)

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

      fun createClient(): Call.Factory {
        val builder = OkHttpClient.Builder()
        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) {
    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/kt/ConfigureTimeouts.kt

    package okhttp3.recipes.kt
    
    import java.util.concurrent.TimeUnit
    import okhttp3.OkHttpClient
    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 =
    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)
  3. maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java

                            }
                        }
                    }
    
                    PlexusConfiguration connectTimeoutXml = config.getChild("connectTimeout", false);
                    if (connectTimeoutXml != null) {
                        connectTimeout = Integer.parseInt(connectTimeoutXml.getValue());
                    } else {
                        // fallback configuration name
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Thu Apr 25 14:13:36 GMT 2024
    - 27.5K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/platform/AndroidPlatform.kt

        ).filter { it.isSupported() }
    
      @Throws(IOException::class)
      override fun connectSocket(
        socket: Socket,
        address: InetSocketAddress,
        connectTimeout: Int,
      ) {
        try {
          socket.connect(address, connectTimeout)
        } catch (e: ClassCastException) {
          // On android 8.0, socket.connect throws a ClassCastException due to a bug
          // see https://issuetracker.google.com/issues/63649622
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

      @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 {
          builder.writeTimeout(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)
  6. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

         *
         * The connect timeout is applied when connecting a TCP socket to the target host. The default
         * value is 10 seconds.
         */
        fun connectTimeout(
          timeout: Long,
          unit: TimeUnit,
        ) = apply {
          connectTimeout = checkDuration("timeout", timeout, unit)
        }
    
        /**
         * Sets the default connect timeout for new connections. A value of 0 means no timeout,
    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)
  7. 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(connectTimeoutMillis = checkDuration("connectTimeout", timeout.toLong(), unit))
      }
    
      override fun readTimeoutMillis(): Int = readTimeoutMillis
    
      override fun withReadTimeout(
        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)
  8. okhttp/src/main/kotlin/okhttp3/internal/platform/Platform.kt

      }
    
      @Throws(IOException::class)
      open fun connectSocket(
        socket: Socket,
        address: InetSocketAddress,
        connectTimeout: Int,
      ) {
        socket.connect(address, connectTimeout)
      }
    
      open fun log(
        message: String,
        level: Int = INFO,
        t: Throwable? = null,
      ) {
        val logLevel = if (level == WARN) Level.WARNING else Level.INFO
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (1)
  9. okhttp/src/test/java/okhttp3/InterceptorTest.kt

        val request =
          Request.Builder()
            .url(server.url("/"))
            .build()
        val response = client.newCall(request).execute()
        response.body.close()
      }
    
      @Test
      fun connectTimeout() {
        val interceptor1 =
          Interceptor { chainA: Interceptor.Chain ->
            assertThat(chainA.connectTimeoutMillis()).isEqualTo(5000)
            val chainB = chainA.withConnectTimeout(100, TimeUnit.MILLISECONDS)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/FastFallbackTest.kt

          listOf(
            localhostIpv4,
            localhostIpv6,
          )
    
        client =
          clientTestRule.newClientBuilder()
            .eventListenerFactory(clientTestRule.wrap(listener))
            .connectTimeout(60, TimeUnit.SECONDS) // Deliberately exacerbate slow fallbacks.
            .dns { dnsResults }
            .fastFallback(true)
            .build()
        url =
          serverIpv4.url("/")
            .newBuilder()
    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