Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 59 for dispatch (0.21 sec)

  1. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

      }
    
      @Test
      fun dispatcher() {
        var dispatcher = Dispatcher()
        dispatcher = Dispatcher(Executors.newCachedThreadPool())
        val maxRequests: Int = dispatcher.maxRequests
        dispatcher.maxRequests = 0
        val maxRequestsPerHost: Int = dispatcher.maxRequestsPerHost
        dispatcher.maxRequestsPerHost = 0
        val executorService: ExecutorService = dispatcher.executorService
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  2. samples/tlssurvey/src/main/kotlin/okhttp3/survey/ssllabs/SslLabsScrape.kt

        }
      }
    }
    
    suspend fun main() {
      val client = OkHttpClient()
    
      val scraper = SslLabsScraper(client)
    
      println(scraper.query())
    
      client.connectionPool.evictAll()
      client.dispatcher.executorService.shutdown()
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

        lock.assertHeld()
    
        val routeUrl = route.address.url
    
        if (url.port != routeUrl.port) {
          return false // Port mismatch.
        }
    
        if (url.host == routeUrl.host) {
          return true // Host match. The URL is supported.
        }
    
        // We have a host mismatch. But if the certificate matches, we're still good.
        return !noCoalescedConnections && handshake != null && certificateSupportHost(url, handshake!!)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  4. okcurl/src/main/kotlin/okhttp3/curl/Main.kt

        }
        return builder.build()
      }
    
      fun close() {
        val okHttpClient = client as OkHttpClient
        okHttpClient.connectionPool.evictAll() // Close any persistent connections.
        okHttpClient.dispatcher.executorService.shutdownNow()
      }
    
      companion object {
        internal const val NAME = "okcurl"
        internal const val DEFAULT_TIMEOUT = -1
    
        private fun versionString(): String? {
    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)
  5. mockwebserver/src/main/kotlin/mockwebserver3/QueueDispatcher.kt

    import java.util.concurrent.LinkedBlockingQueue
    import java.util.logging.Logger
    import okhttp3.ExperimentalOkHttpApi
    
    /**
     * Default dispatcher that processes a script of responses. Populate the script by calling [enqueueResponse].
     */
    @ExperimentalOkHttpApi
    open class QueueDispatcher : Dispatcher() {
      protected val responseQueue: BlockingQueue<MockResponse> = LinkedBlockingQueue()
      private var failFastResponse: MockResponse? = null
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

       * byte of a frame but no more frames.
       */
      @Test
      fun readTimeoutAppliesWithinFrames() {
        webServer.dispatcher =
          object : Dispatcher() {
            override fun dispatch(request: RecordedRequest): MockResponse {
              return upgradeResponse(request)
                .body(Buffer().write("81".decodeHex())) // Truncated frame.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
  7. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        mockWebServer.start(0)
        mockWebServer.start(InetAddress.getLocalHost(), 0)
        mockWebServer.shutdown()
        var dispatcher: Dispatcher = mockWebServer.dispatcher
        dispatcher = mockWebServer.dispatcher
        mockWebServer.dispatcher = QueueDispatcher()
        mockWebServer.dispatcher = QueueDispatcher()
        mockWebServer.close()
      }
    
      @Test @Ignore
      fun pushPromise() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.3K bytes
    - Viewed (1)
  8. okhttp/src/test/java/okhttp3/TestTls13Request.kt

        .build()
    
    private fun testClient(
      urls: List<String>,
      client: OkHttpClient,
    ) {
      try {
        for (url in urls) {
          sendRequest(client, url)
        }
      } finally {
        client.dispatcher.executorService.shutdownNow()
        client.connectionPool.evictAll()
      }
    }
    
    private fun buildClient(vararg specs: ConnectionSpec): OkHttpClient {
      return OkHttpClient.Builder()
        .connectionSpecs(listOf(*specs))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/Dispatcher.kt

    import okhttp3.internal.threadFactory
    
    /**
     * Policy on when async requests are executed.
     *
     * Each dispatcher uses an [ExecutorService] to run calls internally. If you supply your own
     * executor, it should be able to run [the configured maximum][maxRequests] number of calls
     * concurrently.
     */
    class Dispatcher() {
      internal val lock: ReentrantLock = ReentrantLock()
    
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 9K bytes
    - Viewed (0)
  10. android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt

        try {
          InetAddress.getByName("www.google.com")
        } catch (uhe: UnknownHostException) {
          throw TestAbortedException(uhe.message, uhe)
        }
      }
    
      fun OkHttpClient.close() {
        dispatcher.executorService.shutdown()
        connectionPool.evictAll()
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 27K bytes
    - Viewed (1)
Back to top