Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 40 for EventListener (0.2 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

    import java.net.Proxy
    import java.util.concurrent.TimeUnit
    
    class ClientRuleEventListener(
      val delegate: EventListener = NONE,
      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()
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 6K bytes
    - Viewed (0)
  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;
    
    /**
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sun Feb 16 23:20:49 UTC 2020
    - 5.3K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

        Logger.getLogger(TaskRunner::class.java.name).fn()
        Logger.getLogger("javax.net.ssl").fn()
      }
    
      fun wrap(eventListener: EventListener) = EventListener.Factory { ClientRuleEventListener(eventListener, ::addEvent) }
    
      fun wrap(eventListenerFactory: EventListener.Factory) =
        EventListener.Factory { call -> ClientRuleEventListener(eventListenerFactory.create(call), ::addEvent) }
    
      /**
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/WiresharkExample.kt

     */
    @SuppressSignatureCheck
    class WireSharkListenerFactory(
      private val logFile: File,
      private val tlsVersions: List<TlsVersion>,
      private val launch: Launch? = null,
    ) : EventListener.Factory {
      override fun create(call: Call): EventListener {
        return WireSharkKeyLoggerListener(logFile, launch == null)
      }
    
      fun launchWireShark(): Process? {
        when (launch) {
          null -> {
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  5. okhttp/src/test/java/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()
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  6. 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;
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sat Apr 06 09:14:38 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheInterceptor.kt

        val networkRequest = strategy.networkRequest
        val cacheResponse = strategy.cacheResponse
    
        cache?.trackResponse(strategy)
        val listener = (call as? RealCall)?.eventListener ?: EventListener.NONE
    
        if (cacheCandidate != null && cacheResponse == null) {
          // The cache candidate wasn't applicable. Close it.
          cacheCandidate.body.closeQuietly()
        }
    
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Fri Mar 22 07:09:21 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  8. docs/features/caching.md

              // $0.05 worth of phone storage in 2020
              maxSize = 50L * 1024L * 1024L // 50 MiB
          ))
          .build()
    ```
    
    ## EventListener events 
    
    Cache Events are exposed via the EventListener API.  Typical scenarios are below.
    
    ### Cache Hit
    
    In the ideal scenario the cache can fulfill the request without any conditional call to the network.
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sun Feb 06 02:19:09 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java

        new PrintEvents().run();
      }
    
      private static final class PrintingEventListener extends EventListener {
        private static final Factory FACTORY = new Factory() {
          final AtomicLong nextCallId = new AtomicLong(1L);
    
          @Override public EventListener create(Call call) {
            long callId = nextCallId.getAndIncrement();
            System.out.printf("%04d %s%n", callId, call.request().url());
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sun Feb 16 23:20:49 UTC 2020
    - 6.1K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/ConnectionCoalescingTest.kt

        val latch1 = CountDownLatch(1)
        val latch2 = CountDownLatch(1)
        val latch3 = CountDownLatch(1)
        val latch4 = CountDownLatch(1)
        val listener1: EventListener =
          object : EventListener() {
            override fun connectStart(
              call: Call,
              inetSocketAddress: InetSocketAddress,
              proxy: Proxy,
            ) {
              try {
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 18.7K bytes
    - Viewed (0)
Back to top