- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 22 for eventListener (0.07 seconds)
-
okhttp-testing-support/src/main/kotlin/okhttp3/EventListenerRelay.kt
.apply { listeners += ::onEvent } val eventListener: EventListener get() = eventListenerAdapter var eventCount = 0 private fun onEvent(callEvent: CallEvent) { if (eventCount++ == 0) { eventRecorder.logEvent(callEvent) val next = EventListenerRelay(call, eventRecorder) call.addEventListener(next.eventListener) } }Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 1.5K bytes - Click Count (0) -
docs/features/events.md
0001 0.624 connectionReleased 0001 0.624 callEnd ``` The `EventListener.Factory` also makes it possible to limit metrics to a subset of calls. This one captures metrics on a random 10%: ```java class MetricsEventListener extends EventListener { private static final Factory FACTORY = new Factory() { @Override public EventListener create(Call call) { if (Math.random() < 0.10) {Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Mar 15 09:01:42 GMT 2026 - 7.7K bytes - Click Count (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt
import java.util.concurrent.TimeUnit import okhttp3.Call import okhttp3.Connection import okhttp3.Dispatcher import okhttp3.EventListener import okhttp3.Handshake import okhttp3.HttpUrl import okhttp3.OkHttpClient import okhttp3.Protocol import okhttp3.Request import okhttp3.Response /** * An OkHttp EventListener, which logs call events. Can be applied as an * [event listener factory][OkHttpClient.eventListenerFactory]. *
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Mon Oct 06 13:40:20 GMT 2025 - 5.8K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/http/SocketFailureTest.kt
@StartStop private val server = MockWebServer() private var client = clientTestRule .newClientBuilder() .eventListener(listener) .build() class SocketClosingEventListener : EventListener() { var shouldClose: Boolean = false var lastSocket: Socket? = null override fun connectionAcquired( call: Call, connection: Connection, ) {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Jul 29 21:11:09 GMT 2025 - 3K bytes - Click Count (0) -
android-test/src/androidDeviceTest/java/okhttp/android/test/alpn/AlpnOverrideTest.kt
listOf( ConnectionSpec .Builder(ConnectionSpec.MODERN_TLS) .supportsTlsExtensions(false) .build(), ), ).eventListener( object : EventListener() { override fun connectionAcquired( call: Call, connection: Connection, ) { val sslSocket = connection.socket() as SSLSocket
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Mon Jan 26 07:38:51 GMT 2026 - 2.8K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Call.kt
*/ fun timeout(): Timeout /** * Configure this call to publish all future events to [eventListener], in addition to the * listeners configured by [OkHttpClient.Builder.eventListener] and other calls to this function. * * If this call is later [cloned][clone], [eventListener] will not be notified of its events. *
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 6.8K bytes - Click Count (0) -
samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java
import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Proxy; import java.util.List; import okhttp3.Call; import okhttp3.Connection; import okhttp3.EventListener; import okhttp3.Handshake; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Protocol; import okhttp3.Request; import okhttp3.Response; /**
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Feb 16 23:20:49 GMT 2020 - 5.3K bytes - Click Count (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/EventRecorder.kt
/** * An override to ignore the normal order that is enforced. * EventListeners added by Interceptors will not see all events. */ private val enforceOrder: Boolean = true, ) { private val eventListenerAdapter = EventListenerAdapter() .apply { listeners += ::logEvent } val eventListener: EventListener get() = eventListenerAdapter /** Events that haven't yet been removed. */Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Jan 27 09:00:39 GMT 2026 - 4.5K bytes - Click Count (0) -
okhttp-logging-interceptor/api/logging-interceptor.api
} public class okhttp3/logging/LoggingEventListener$Factory : okhttp3/EventListener$Factory { public fun <init> ()V public fun <init> (Lokhttp3/logging/HttpLoggingInterceptor$Logger;)V public synthetic fun <init> (Lokhttp3/logging/HttpLoggingInterceptor$Logger;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun create (Lokhttp3/Call;)Lokhttp3/EventListener;Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Oct 07 15:15:46 GMT 2025 - 4.6K bytes - Click Count (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/FailingCall.kt
override fun isExecuted(): Boolean = error("unexpected") override fun isCanceled(): Boolean = error("unexpected") override fun timeout(): Timeout = error("unexpected") override fun addEventListener(eventListener: EventListener) = error("unexpected") override fun <T : Any> tag(type: KClass<T>): T? = error("unexpected") override fun <T> tag(type: Class<out T>): T? = error("unexpected") override fun <T : Any> tag(
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 1.6K bytes - Click Count (0)