- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 20 for EventListener (0.06 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 Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 1.5K 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 Dec 26 11:42:13 GMT 2025 - Last Modified: Mon Oct 06 13:40:20 GMT 2025 - 5.8K bytes - Click Count (0) -
docs/features/events.md
* The performance of these calls on the underlying network. If the network’s performance isn’t sufficient, you need to either improve the network or use less of it. ### EventListener Subclass [EventListener](https://square.github.io/okhttp/3.x/okhttp/okhttp3/EventListener.html) and override methods for the events you are interested in. In a successful HTTP call with no redirects or retries the sequence of events is described by this flow.
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Sun Feb 06 02:19:09 GMT 2022 - 7.7K 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 Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Jul 29 21:11:09 GMT 2025 - 3K bytes - Click Count (0) -
android-test/src/androidTest/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 Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Mar 19 19:25:20 GMT 2025 - 2.8K bytes - Click Count (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RouteSelector.kt
if (proxiesOrNull.isNullOrEmpty()) return immutableListOf(Proxy.NO_PROXY) return proxiesOrNull.toImmutableList() } call.eventListener.proxySelectStart(call, url) proxies = selectProxies() nextProxyIndex = 0 call.eventListener.proxySelectEnd(call, url, proxies) } /** Returns true if there's another proxy to try. */
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Oct 08 03:50:05 GMT 2025 - 7.3K bytes - Click Count (2) -
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 Dec 26 11:42:13 GMT 2025 - Last Modified: Sun Feb 16 23:20:49 GMT 2020 - 5.3K 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 Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 6.8K bytes - Click Count (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt
import java.net.Proxy import java.util.concurrent.TimeUnit class ClientRuleEventListener( var logger: (String) -> Unit, ) : EventListener(), EventListener.Factory { private var startNs: Long? = null override fun create(call: Call): EventListener = this override fun callStart(call: Call) { startNs = System.nanoTime() logWithTime("callStart: ${call.request()}") }
Created: Fri Dec 26 11:42:13 GMT 2025 - Last Modified: Tue Oct 07 21:03:04 GMT 2025 - 5.4K 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 Dec 26 11:42:13 GMT 2025 - Last Modified: Wed Nov 05 18:28:35 GMT 2025 - 1.6K bytes - Click Count (0)