- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for throttleBody (2.35 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/internal/http/ThreadInterruptTest.kt
@Test fun interruptReadingResponseBody() { val responseBodySize = 8 * 1024 * 1024 // 8 MiB. server.enqueue( MockResponse() .setBody(Buffer().write(ByteArray(responseBodySize))) .throttleBody((64 * 1024).toLong(), 125, TimeUnit.MILLISECONDS), ) // 500 Kbps server.start() val call = client.newCall( Request .Builder() .url(server.url("/"))
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 11:30:11 UTC 2025 - 6.1K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/http/CancelTest.kt
val responseBodySize = 8 * 1024 * 1024 // 8 MiB. server.enqueue( MockResponse .Builder() .body( Buffer() .write(ByteArray(responseBodySize)), ).throttleBody(64 * 1024, 125, MILLISECONDS) // 500 Kbps .build(), ) val call = client.newCall(Request(server.url("/"))) val response = call.execute() cancelLater(call, 500)
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 9.8K bytes - Viewed (0) -
mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt
) fun getHttp2ErrorCode(): Int = http2ErrorCode fun setHttp2ErrorCode(http2ErrorCode: Int) = apply { this.http2ErrorCode = http2ErrorCode } fun throttleBody( bytesPerPeriod: Long, period: Long, unit: TimeUnit, ) = apply { throttleBytesPerPeriod = bytesPerPeriod throttlePeriodAmount = period throttlePeriodUnit = unit }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat May 10 11:15:14 UTC 2025 - 7.1K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 28.2K bytes - Viewed (0) -
mockwebserver/README.md
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jul 19 13:40:52 UTC 2025 - 8.1K bytes - Viewed (0) -
mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/DeprecationBridge.kt
SocketPolicy.NO_RESPONSE -> result.onResponseStart(SocketEffect.Stall) SocketPolicy.RESET_STREAM_AT_START -> result.onRequestStart(CloseStream(http2ErrorCode)) } result.throttleBody(throttleBytesPerPeriod, getThrottlePeriod(MILLISECONDS), MILLISECONDS) result.bodyDelay(getBodyDelay(MILLISECONDS), MILLISECONDS) result.headersDelay(getHeadersDelay(MILLISECONDS), MILLISECONDS) return result.build() }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Jul 03 13:16:34 UTC 2025 - 4.1K bytes - Viewed (0) -
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))
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 60.4K bytes - Viewed (0) -
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)
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 17.8K bytes - Viewed (0) -
mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt
* should yield one sleep for a total delay of 500ms. */ @Test fun throttleRequest() { assumeNotWindows() server.enqueue( MockResponse() .throttleBody(3, 500, TimeUnit.MILLISECONDS), ) val startNanos = System.nanoTime() val connection = server.url("/").toUrl().openConnection() connection.setDoOutput(true)
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Thu Jul 03 13:16:34 UTC 2025 - 22.3K bytes - Viewed (0) -
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;
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 11.8K bytes - Viewed (0)