Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for connectionCount (0.22 sec)

  1. okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt

        setPolicy(pool, address, ConnectionPool.AddressPolicy(2))
        assertThat(pool.connectionCount()).isEqualTo(2)
    
        // Connections are replaced if they idle out or are evicted from the pool
        evictAllConnections(pool)
        assertThat(pool.connectionCount()).isEqualTo(2)
        forceConnectionsToExpire(pool, expireTime)
        assertThat(pool.connectionCount()).isEqualTo(2)
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/ConnectionCoalescingTest.kt

        assert200Http2Response(execute(url), server.hostName)
        val sanUrl = url.newBuilder().host("san.com").build()
        assert200Http2Response(execute(sanUrl), "san.com")
        assertThat(client.connectionPool.connectionCount()).isEqualTo(1)
      }
    
      /**
       * Test connecting to an alternative host then common name, although only subject alternative
       * names are used if present no special consideration of common name.
       */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/ConnectionPool.kt

      /** Returns the number of idle connections in the pool. */
      fun idleConnectionCount(): Int = delegate.idleConnectionCount()
    
      /** Returns total number of connections in the pool. */
      fun connectionCount(): Int = delegate.connectionCount()
    
      internal val connectionListener: ConnectionListener
        get() = delegate.connectionListener
    
      /** Close and remove all idle connections in the pool. */
      fun evictAll() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 03 20:39:41 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/SocksProxyTest.kt

        val response2 = client.newCall(request2).execute()
        assertThat(response2.body.string()).isEqualTo("def")
    
        // The HTTP calls should share a single connection.
        assertThat(socksProxy.connectionCount()).isEqualTo(1)
      }
    
      @Test
      fun proxySelector() {
        server.enqueue(MockResponse.Builder().body("abc").build())
        val proxySelector: ProxySelector =
          object : ProxySelector() {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/SocksProxy.kt

          }
        }
      }
    
      fun proxy(): Proxy {
        return Proxy(
          Proxy.Type.SOCKS,
          InetSocketAddress.createUnresolved("localhost", serverSocket!!.localPort),
        )
      }
    
      fun connectionCount(): Int = connectionCount.get()
    
      fun shutdown() {
        serverSocket!!.close()
        executor.shutdown()
        if (!executor.awaitTermination(5, TimeUnit.SECONDS)) {
          throw IOException("Gave up waiting for executor to shut down")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

          connectionPool.evictAll()
          if (connectionPool.connectionCount() > 0) {
            // Minimise test flakiness due to possible race conditions with connections closing.
            // Some number of tests will report here, but not fail due to this delay.
            println("Delaying to avoid flakes")
            Thread.sleep(500L)
            println("After delay: " + connectionPool.connectionCount())
          }
    
          connectionPool.evictAll()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt

          }
        }.also { expected ->
          assertEquals(cancelMode == INTERRUPT, Thread.interrupted())
        }
        responseBody.close()
        assertEquals(if (connectionType == H2) 1 else 0, client.connectionPool.connectionCount())
      }
    
      @ParameterizedTest
      @ArgumentsSource(CancelModelParamProvider::class)
      fun cancelAndFollowup(mode: Pair<CancelMode, ConnectionType>) {
        setUp(mode)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/JSSETest.kt

          assertThat(it.protocol).isEqualTo(Protocol.HTTP_2)
          assertThat(it.handshake!!.tlsVersion).isEqualTo(TlsVersion.TLS_1_3)
        }
    
        client.connectionPool.evictAll()
        assertEquals(0, client.connectionPool.connectionCount())
    
        client.newCall(request).execute().use {
          assertThat(it.protocol).isEqualTo(Protocol.HTTP_2)
          assertThat(it.handshake!!.tlsVersion).isEqualTo(TlsVersion.TLS_1_3)
        }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/SessionReuseTest.kt

        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
        client.connectionPool.evictAll()
        assertEquals(0, client.connectionPool.connectionCount())
    
        // Force reuse. This appears flaky (30% of the time) even though sessions are reused.
        // javax.net.ssl.SSLHandshakeException: No new session is allowed and no existing
        // session can be resumed
        //
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (0)
  10. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
        client.connectionPool.evictAll()
        assertEquals(0, client.connectionPool.connectionCount())
    
        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
        assertEquals(2, sessionIds.size)
        assertEquals(sessionIds[0], sessionIds[1])
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
Back to top