Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 152 for New (0.12 sec)

  1. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

       */
      fun truncateLastFrame(length: Int): Http2Writer {
        val lastFrame = outFrames.removeAt(outFrames.size - 1)
        require(length < bytesOut.size - lastFrame.start)
    
        // Move everything from bytesOut into a new buffer.
        val fullBuffer = Buffer()
        bytesOut.read(fullBuffer, bytesOut.size)
    
        // Copy back all but what we're truncating.
        fullBuffer.read(bytesOut, lastFrame.start + length)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/idn/Punycode.kt

          codePoints.add(i, n)
    
          i++
        }
    
        for (codePoint in codePoints) {
          result.writeUtf8CodePoint(codePoint)
        }
    
        return true
      }
    
      /** Returns a new bias. */
      private fun adapt(
        delta: Int,
        numpoints: Int,
        first: Boolean,
      ): Int {
        var delta =
          when {
            first -> delta / DAMP
            else -> delta / 2
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 03 03:04:50 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  3. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

      public void run() throws Exception {
        File socketFile = new File("/tmp/ClientAndServer.sock");
        socketFile.delete(); // Clean up from previous runs.
    
        MockWebServer server = new MockWebServer();
        server.setServerSocketFactory(new UnixDomainServerSocketFactory(socketFile));
        server.setProtocols(Collections.singletonList(Protocol.H2_PRIOR_KNOWLEDGE));
        server.enqueue(new MockResponse().setBody("hello"));
        server.start();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Dec 24 03:46:30 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  4. samples/guide/src/main/java/okhttp3/recipes/CertificatePinning.java

    public final class CertificatePinning {
      private final OkHttpClient client = new OkHttpClient.Builder()
          .certificatePinner(
              new CertificatePinner.Builder()
                  .add("publicobject.com", "sha256/Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=")
                  .build())
          .build();
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/robots.txt")
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 08 21:30:01 GMT 2019
    - 1.7K bytes
    - Viewed (0)
  5. okhttp-logging-interceptor/README.md

    ```java
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
    logging.setLevel(Level.BASIC);
    OkHttpClient client = new OkHttpClient.Builder()
      .addInterceptor(logging)
      .build();
    ```
    
    You can change the log level at any time by calling `setLevel()`.
    
    To log to a custom location, pass a `Logger` instance to the constructor.
    ```java
    HttpLoggingInterceptor logging = new HttpLoggingInterceptor(new Logger() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  6. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainServerSocketFactory.java

        }
    
        @Override public Socket accept() throws IOException {
          try {
            UnixSocketChannel channel = serverSocketChannel.accept();
            return new TunnelingUnixSocket(path, channel, endpoint);
          } catch (ClosedChannelException e) {
            SocketException exception = new SocketException();
            exception.initCause(e);
            throw exception;
          }
        }
    
        @Override public void close() throws IOException {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Feb 12 16:33:52 GMT 2019
    - 3.1K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/CustomTrust.java

            //.addPlatformTrustedCertificates()
            .build();
    
        client = new OkHttpClient.Builder()
                .sslSocketFactory(certificates.sslSocketFactory(), certificates.trustManager())
                .build();
      }
    
      public void run() throws Exception {
        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 9.3K bytes
    - Viewed (2)
  8. docs/contribute/concurrency.md

    This is necessary for bookkeeping when creating new streams. Correct framing requires that stream IDs are sequential on the socket, so we need to bundle assigning the ID with sending the `SYN_STREAM` frame.
    
    ## Connection Pool
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:35:36 GMT 2022
    - 7K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/Cache.kt

     *
     * ```java
     * Request request = new Request.Builder()
     *     .cacheControl(new CacheControl.Builder().noCache().build())
     *     .url("http://publicobject.com/helloworld.txt")
     *     .build();
     * ```
     *
     * If it is only necessary to force a cached response to be validated by the server, use the more
     * efficient `max-age=0` directive instead:
     *
     * ```java
     * Request request = new Request.Builder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  10. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

            headers.add(header)
          }
    
        /**
         * Adds a new header with the name and value. This may be used to add multiple headers with the
         * same name.
         */
        fun addHeader(
          name: String,
          value: Any,
        ) = apply {
          headers.add(name, value.toString())
        }
    
        /**
         * Adds a new header with the name and value. This may be used to add multiple headers with the
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
Back to top