Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 51 for EventListener (0.05 seconds)

  1. okhttp/src/commonJvmAndroid/kotlin/okhttp3/EventListener.kt

         * from this method.**
         */
        fun create(call: Call): EventListener
      }
    
      companion object {
        @JvmField
        val NONE: EventListener =
          object : EventListener() {
          }
      }
    
      private class AggregateEventListener(
        val eventListeners: Array<EventListener>,
      ) : EventListener() {
        override fun callStart(call: Call) {
          for (delegate in eventListeners) {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Oct 07 21:03:04 GMT 2025
    - 24.9K bytes
    - Click Count (0)
  2. 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)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealCall.kt

      override fun timeout(): Timeout = timeout
    
      override fun addEventListener(eventListener: EventListener) {
        // Atomically replace the current eventListener with a composite one.
        do {
          val previous = this.eventListener
        } while (!eventListenerUpdater.compareAndSet(this, previous, previous + eventListener))
      }
    
      override fun <T : Any> tag(type: KClass<T>): T? = type.java.cast(tags.get()[type])
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Nov 05 18:28:35 GMT 2025
    - 19.7K bytes
    - Click Count (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/Exchange.kt

        }
        if (requestDone) {
          if (e != null) {
            call.eventListener.requestFailed(call, e)
          } else {
            call.eventListener.requestBodyEnd(call, bytesRead)
          }
        }
        if (responseDone) {
          if (e != null) {
            call.eventListener.responseFailed(call, e)
          } else {
            call.eventListener.responseBodyEnd(call, bytesRead)
          }
        }
        return call.messageDone(
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Nov 05 18:28:35 GMT 2025
    - 10.5K bytes
    - Click Count (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/ConnectPlan.kt

            )
          this.connection = connection
          connection.start()
    
          // Success.
          call.eventListener.connectEnd(call, route.socketAddress, route.proxy, protocol)
          success = true
          return ConnectResult(plan = this)
        } catch (e: IOException) {
          call.eventListener.connectFailed(call, route.socketAddress, route.proxy, null, e)
          connectionPool.connectionListener.connectFailed(route, call, e)
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Oct 08 03:50:05 GMT 2025
    - 19.3K bytes
    - Click Count (2)
  6. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

              ioe: IOException,
            ) = TODO()
    
            override fun canceled(call: Call) = TODO()
          }
        val none: EventListener = EventListener.NONE
      }
    
      @Test
      fun eventListenerBuilder() {
        var builder: EventListener.Factory = EventListener.Factory { TODO() }
      }
    
      @Test
      fun formBody() {
        val formBody: FormBody = FormBody.Builder().build()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Nov 05 18:28:35 GMT 2025
    - 47K bytes
    - Click Count (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to Top