Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for init (0.15 sec)

  1. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

        keyManagerFactory.init(keystore, password.toCharArray());
    
        TrustManagerFactory trustManagerFactory =
            TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        trustManagerFactory.init(keystore);
    
        SSLContext sslContext = SSLContext.getInstance("TLS");
        sslContext.init(
            keyManagerFactory.getKeyManagers(),
    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)
  2. samples/guide/src/main/java/okhttp3/recipes/CustomCipherSuites.java

            String host, int port, InetAddress localHost, int localPort) throws IOException {
          return configureSocket((SSLSocket) delegate.createSocket(host, port, localHost, localPort));
        }
    
        @Override public Socket createSocket(InetAddress host, int port) throws IOException {
          return configureSocket((SSLSocket) delegate.createSocket(host, port));
        }
    
        @Override public Socket createSocket(
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Mar 14 21:57:42 GMT 2019
    - 6.5K bytes
    - Viewed (0)
  3. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java

      @Override public Socket createSocket(String host, int port) throws IOException {
        Socket result = createSocket();
    
        try {
          result.connect(new InetSocketAddress(host, port));
        } catch (IOException e) {
          result.close();
          throw e;
        }
        return result;
      }
    
      @Override public Socket createSocket(
          String host, int port, InetAddress localHost, int localPort) 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)
  4. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

            sink.writeUtf8("Numbers\n");
            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);
    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)
  5. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

      private final OkHttpClient httpClient;
      private final Moshi moshi;
    
      public final String clientId;
      public final String clientSecret;
      public final int port;
    
      public SlackApi(String clientId, String clientSecret, int port) {
        this.httpClient = new OkHttpClient.Builder()
            .build();
        this.moshi = new Moshi.Builder()
            .add(new SlackJsonAdapters())
            .build();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 19:30:55 GMT 2018
    - 4.4K bytes
    - Viewed (1)
  6. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainServerSocketFactory.java

      }
    
      @Override public ServerSocket createServerSocket(int port) throws IOException {
        return createServerSocket();
      }
    
      @Override public ServerSocket createServerSocket(int port, int backlog) throws IOException {
        return createServerSocket();
      }
    
      @Override public ServerSocket createServerSocket(
          int port, int backlog, InetAddress inetAddress) throws IOException {
        return createServerSocket();
    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

            .build();
    
        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) {
            Headers responseHeaders = response.headers();
            for (int i = 0; i < responseHeaders.size(); i++) {
              System.out.println(responseHeaders.name(i) + ": " + responseHeaders.value(i));
            }
    
            throw new IOException("Unexpected code " + response);
          }
    
    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. samples/guide/src/main/java/okhttp3/recipes/SynchronousGet.java

        try (Response response = client.newCall(request).execute()) {
          if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
    
          Headers responseHeaders = response.headers();
          for (int i = 0; i < responseHeaders.size(); i++) {
            System.out.println(responseHeaders.name(i) + ": " + responseHeaders.value(i));
          }
    
          System.out.println(response.body().string());
        }
      }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.5K bytes
    - Viewed (0)
  9. samples/slack/src/main/java/okhttp3/slack/SlackClient.java

        rtmSession.open(accessToken);
      }
    
      public static void main(String... args) throws Exception {
        String clientId = "0000000000.00000000000";
        String clientSecret = "00000000000000000000000000000000";
        int port = 53203;
        SlackApi slackApi = new SlackApi(clientId, clientSecret, port);
    
        SlackClient client = new SlackClient(slackApi);
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.4K bytes
    - Viewed (0)
  10. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

      public Crawler(OkHttpClient client) {
        this.client = client;
      }
    
      private void parallelDrainQueue(int threadCount) {
        ExecutorService executor = Executors.newFixedThreadPool(threadCount);
        for (int i = 0; i < threadCount; i++) {
          executor.execute(() -> {
            try {
              drainQueue();
            } catch (Exception e) {
              e.printStackTrace();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
Back to top