Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for factor (0.2 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

            sink.writeUtf8("-------\n");
            for (int i = 2; i <= 997; i++) {
              sink.writeUtf8(String.format(" * %s = %s\n", i, factor(i)));
            }
          }
    
          private String factor(int n) {
            for (int i = 2; i < n; i++) {
              int x = n / i;
              if (x * i == n) return factor(x) + " × " + i;
            }
            return Integer.toString(n);
          }
        };
    
        Request request = new Request.Builder()
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/kt/PostStreaming.kt

              sink.writeUtf8("-------\n")
              for (i in 2..997) {
                sink.writeUtf8(String.format(" * $i = ${factor(i)}\n"))
              }
            }
    
            private fun factor(n: Int): String {
              for (i in 2 until n) {
                val x = n / i
                if (x * i == n) return "${factor(x)} × $i"
              }
              return n.toString()
            }
          }
    
        val request =
          Request(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

                sink.writeUtf8(String.format(" * %s = %s\n", i, factor(i)));
              }
              sink.close();
            } catch (IOException | InterruptedException e) {
              e.printStackTrace();
            }
          }
    
          private String factor(int n) {
            for (int i = 2; i < n; i++) {
              int x = n / i;
              if (x * i == n) return factor(x) + " × " + i;
            }
            return Integer.toString(n);
    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)
  4. docs/features/events.md

    0001 0.624 responseBodyEnd
    0001 0.624 connectionReleased
    0001 0.624 callEnd
    ```
    
    The `EventListener.Factory` also makes it possible to limit metrics to a subset of calls. This one captures metrics on a random 10%:
    
    ```java
    class MetricsEventListener extends EventListener {
      private static final Factory FACTORY = new Factory() {
        @Override public EventListener create(Call call) {
          if (Math.random() < 0.10) {
    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)
  5. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt

        level = DeprecationLevel.HIDDEN,
      )
      @JvmStatic
      fun createFactory(client: OkHttpClient) = createFactory(client as Call.Factory)
    
      @JvmStatic
      fun createFactory(callFactory: Call.Factory): EventSource.Factory {
        return EventSource.Factory { request, listener ->
          val actualRequest =
            if (request.header("Accept") == null) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:18:15 GMT 2024
    - 1.6K bytes
    - Viewed (1)
  6. okhttp-android/api/okhttp-android.api

    	public static synthetic fun androidLogging$default (Lokhttp3/logging/HttpLoggingInterceptor$Companion;ILjava/lang/String;ILjava/lang/Object;)Lokhttp3/logging/HttpLoggingInterceptor;
    	public static synthetic fun androidLogging$default (Lokhttp3/logging/LoggingEventListener$Companion;ILjava/lang/String;ILjava/lang/Object;)Lokhttp3/logging/LoggingEventListener$Factory;
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 11:07:32 GMT 2024
    - 1.3K bytes
    - Viewed (1)
  7. okhttp/src/main/kotlin/okhttp3/internal/platform/android/BouncyCastleSocketAdapter.kt

          sslParameters.applicationProtocols = Platform.alpnProtocolNames(protocols).toTypedArray()
    
          bcSocket.parameters = sslParameters
        }
      }
    
      companion object {
        val factory =
          object : DeferredSocketAdapter.Factory {
            override fun matchesSocket(sslSocket: SSLSocket): Boolean {
              return BouncyCastlePlatform.isSupported && sslSocket is BCSSLSocket
            }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  8. okcurl/src/main/kotlin/okhttp3/curl/Main.kt

      var client: Call.Factory? = null
    
      override fun run() {
        LoggingUtil.configureLogging(debug = verbose, showHttp2Frames = showHttp2Frames, sslDebug = sslDebug)
    
        commonRun()
      }
    
      fun createRequest(): Request = commonCreateRequest()
    
      fun createClient(): Call.Factory {
        val builder = OkHttpClient.Builder()
        builder.followSslRedirects(followRedirects)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (1)
  9. okhttp/src/test/java/okhttp3/OpenJSSETest.kt

          assertThat(response.exchangeAccessor!!.connectionAccessor.socket())
            .isInstanceOf<SSLSocketImpl>()
        }
      }
    
      @Test
      fun testSupportedProtocols() {
        val factory = SSLSocketFactoryImpl()
        val s = factory.createSocket() as SSLSocketImpl
    
        assertEquals(listOf("TLSv1.3", "TLSv1.2"), s.enabledProtocols.toList())
      }
    
      @Test
      @Disabled
      fun testMozilla() {
        assumeNetwork()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  10. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

      /**
       * Immediately and violently release resources held by this event source. This does nothing if
       * the event source has already been closed or canceled.
       */
      fun cancel()
    
      fun interface Factory {
        /**
         * Creates a new event source and immediately returns it. Creating an event source initiates an
         * asynchronous process to connect the socket. Once that succeeds or fails, `listener` will be
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top