Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 19 of 19 for throttleBody (0.06 seconds)

  1. mockwebserver-deprecated/api/mockwebserver.api

    	public final fun setTrailers (Lokhttp3/Headers;)Lokhttp3/mockwebserver/MockResponse;
    	public final fun socketPolicy (Lokhttp3/mockwebserver/SocketPolicy;)V
    	public final fun status (Ljava/lang/String;)V
    	public final fun throttleBody (JJLjava/util/concurrent/TimeUnit;)Lokhttp3/mockwebserver/MockResponse;
    	public fun toString ()Ljava/lang/String;
    	public final fun trailers (Lokhttp3/Headers;)V
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Jul 22 12:28:51 GMT 2023
    - 10.2K bytes
    - Click Count (0)
  2. mockwebserver/api/mockwebserver3.api

    	public final fun socketHandler (Lmockwebserver3/SocketHandler;)Lmockwebserver3/MockResponse$Builder;
    	public final fun status (Ljava/lang/String;)Lmockwebserver3/MockResponse$Builder;
    	public final fun throttleBody (JJLjava/util/concurrent/TimeUnit;)Lmockwebserver3/MockResponse$Builder;
    	public final fun trailers (Lokhttp3/Headers;)Lmockwebserver3/MockResponse$Builder;
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Jun 20 11:46:46 GMT 2025
    - 11.8K bytes
    - Click Count (0)
  3. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        /**
         * Throttles the request reader and response writer to sleep for the given period after each
         * series of [bytesPerPeriod] bytes are transferred. Use this to simulate network behavior.
         */
        public fun throttleBody(
          bytesPerPeriod: Long,
          period: Long,
          unit: TimeUnit,
        ): Builder =
          apply {
            throttleBytesPerPeriod = bytesPerPeriod
            throttlePeriodNanos = unit.toNanos(period)
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Jun 20 11:46:46 GMT 2025
    - 17.8K bytes
    - Click Count (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/EventListenerTest.kt

        }
      }
    
      @Test
      fun failedDribbledCallEventSequence() {
        server.enqueue(
          MockResponse
            .Builder()
            .body("0123456789")
            .throttleBody(2, 100, TimeUnit.MILLISECONDS)
            .onResponseBody(CloseSocket())
            .build(),
        )
        client =
          client
            .newBuilder()
            .protocols(listOf<Protocol>(Protocol.HTTP_1_1))
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Nov 05 18:28:35 GMT 2025
    - 70.5K bytes
    - Click Count (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        mockResponse.socketPolicy = SocketPolicy.KEEP_OPEN
        var http2ErrorCode: Int = mockResponse.http2ErrorCode
        mockResponse.http2ErrorCode = 0
        mockResponse = mockResponse.throttleBody(0L, 0L, TimeUnit.SECONDS)
        var throttleBytesPerPeriod: Long = mockResponse.throttleBytesPerPeriod
        throttleBytesPerPeriod = mockResponse.throttleBytesPerPeriod
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Nov 05 18:28:35 GMT 2025
    - 47K bytes
    - Click Count (0)
  6. okhttp/src/jvmTest/kotlin/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val body = CharArray(4096) // 4KiB to read.
        Arrays.fill(body, 'y')
        server.enqueue(
          MockResponse
            .Builder()
            .body(String(body))
            .throttleBody(1024, 1, TimeUnit.SECONDS) // Slow connection 1KiB/second.
            .build(),
        )
        client =
          client
            .newBuilder()
            .readTimeout(Duration.ofSeconds(2))
            .build()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Nov 01 12:18:11 GMT 2025
    - 67.4K bytes
    - Click Count (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/URLConnectionTest.kt

        assertThat(getResponse(Request(url)).code).isEqualTo(407)
      }
    
      @Test
      fun disconnectedConnection() {
        server.enqueue(
          MockResponse
            .Builder()
            .throttleBody(2, 100, TimeUnit.MILLISECONDS)
            .body("ABCD")
            .build(),
        )
        val call = client.newCall(newRequest("/"))
        val response = call.execute()
        val inputStream = response.body.byteStream()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat Jun 21 20:36:35 GMT 2025
    - 133.2K bytes
    - Click Count (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/CallTest.kt

      }
    
      @Test
      fun timeoutsUpdatedOnReusedConnections() {
        server.enqueue(MockResponse(body = "abc"))
        server.enqueue(
          MockResponse
            .Builder()
            .body("def")
            .throttleBody(1, 750, TimeUnit.MILLISECONDS)
            .build(),
        )
    
        // First request: time out after 1s.
        client =
          client
            .newBuilder()
            .readTimeout(Duration.ofSeconds(1))
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 147.4K bytes
    - Click Count (0)
  9. okhttp/src/jvmTest/kotlin/okhttp3/CacheTest.kt

        // Setting a low transfer speed ensures that stream discarding will time out.
        val builder =
          MockResponse
            .Builder()
            .throttleBody(6, 1, TimeUnit.SECONDS)
        transferKind.setBody(builder, "ABCDE\nFGHIJKLMNOPQRSTUVWXYZ", 1024)
        server.enqueue(builder.build())
        server.enqueue(
          MockResponse
            .Builder()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Oct 03 17:41:45 GMT 2025
    - 116.8K bytes
    - Click Count (0)
Back to Top