Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for extends (0.4 sec)

  1. docs/features/events.md

    Here’s a [sample event listener](https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java) that prints each event with a timestamp.
    
    ```java
    class PrintingEventListener extends EventListener {
      private long callStartNanos;
    
      private void printEvent(String name) {
        long nowNanos = System.nanoTime();
        if (name.equals("callStart")) {
          callStartNanos = nowNanos;
        }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  2. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java

    import java.net.Socket;
    import javax.net.SocketFactory;
    import jnr.unixsocket.UnixSocketChannel;
    
    /** Impersonate TCP-style SocketFactory over UNIX domain sockets. */
    public final class UnixDomainSocketFactory extends SocketFactory {
      private final File path;
    
      public UnixDomainSocketFactory(File path) {
        this.path = path;
      }
    
      @Override public Socket createSocket() throws IOException {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 03 21:33:52 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  3. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

    import okhttp3.mockwebserver.MockResponse;
    import okhttp3.mockwebserver.MockWebServer;
    import okhttp3.mockwebserver.RecordedRequest;
    import okio.Buffer;
    import okio.Okio;
    
    public class SampleServer extends Dispatcher {
      private final SSLContext sslContext;
      private final String root;
      private final int port;
    
      public SampleServer(SSLContext sslContext, String root, int port) {
        this.sslContext = sslContext;
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  4. okhttp-brotli/src/main/kotlin/okhttp3/brotli/internal/DecompressionBombChecker.kt

              if (outputByteCount > inputByteCount * maxRatio) {
                throw IOException(
                  "decompression bomb? outputByteCount=$outputByteCount, " +
                    "inputByteCount=$inputByteCount exceeds max ratio of $maxRatio",
                )
              }
            }
    
            return result
          }
        }
      }
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 29 22:50:20 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. samples/slack/src/main/java/okhttp3/slack/RtmSession.java

    import java.io.Closeable;
    import java.io.IOException;
    import okhttp3.WebSocket;
    import okhttp3.Response;
    import okhttp3.WebSocketListener;
    
    /** A realtime messaging session. */
    public final class RtmSession extends WebSocketListener implements Closeable {
      private final SlackApi slackApi;
    
      /** Guarded by this. */
      private WebSocket webSocket;
    
      public RtmSession(SlackApi slackApi) {
        this.slackApi = slackApi;
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Nov 19 20:16:58 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/Progress.java

          System.out.println(response.body().string());
        }
      }
    
      public static void main(String... args) throws Exception {
        new Progress().run();
      }
    
      private static class ProgressResponseBody extends ResponseBody {
    
        private final ResponseBody responseBody;
        private final ProgressListener progressListener;
        private BufferedSource bufferedSource;
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

       * This is potentially useful for posting live event streams like video capture. Callers should
       * write to {@code sink()} and close it to complete the post.
       */
      static final class PipeBody extends RequestBody {
        private final Pipe pipe = new Pipe(8192);
        private final BufferedSink sink = Okio.buffer(pipe.sink());
    
        public BufferedSink sink() {
          return sink;
        }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 3.1K bytes
    - Viewed (0)
  8. okhttp-brotli/src/test/java/okhttp3/brotli/BrotliBombTest.kt

          .message()
          .isNotNull()
          .matches(
            Regex(
              "decompression bomb\\? outputByteCount=\\d+, inputByteCount=\\d+ exceeds max ratio of 100",
            ),
          )
      }
    
      /** Returns a ByteString that expands to 10 GiB when Brotli-decompressed. */
      private fun readBrotli10G(): ByteString {
        val gzippedBrotliBomb =
          (
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 29 22:50:20 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/EventListener.kt

     * limitations under the License.
     */
    package okhttp3
    
    import java.io.IOException
    import java.net.InetAddress
    import java.net.InetSocketAddress
    import java.net.Proxy
    
    /**
     * Listener for metrics events. Extend this class to monitor the quantity, size, and duration of
     * your application's HTTP calls.
     *
     * All start/connect/acquire events will eventually receive a matching end/release event, either
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15.2K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/cache/DiskLruCache.kt

     * multiple processes to use the same cache directory at the same time.
     *
     * This cache limits the number of bytes that it will store on the filesystem. When the number of
     * stored bytes exceeds the limit, the cache will remove entries in the background until the limit
     * is satisfied. The limit is not strict: the cache may temporarily exceed it while waiting for
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 34.7K bytes
    - Viewed (0)
Back to top