Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for close (0.32 sec)

  1. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java

        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 {
        return createSocket(host, port);
    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)
  2. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainServerSocketFactory.java

            SocketException exception = new SocketException();
            exception.initCause(e);
            throw exception;
          }
        }
    
        @Override public void close() throws IOException {
          serverSocketChannel.close();
        }
      }
    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)
  3. samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

        System.out.println("MESSAGE: " + bytes.hex());
      }
    
      @Override public void onClosing(WebSocket webSocket, int code, String reason) {
        webSocket.close(1000, null);
        System.out.println("CLOSE: " + code + " " + reason);
      }
    
      @Override public void onFailure(WebSocket webSocket, Throwable t, Response response) {
        t.printStackTrace();
      }
    
      public static void main(String... args) {
        new WebSocketEcho().run();
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 04 11:40:21 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  4. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

      }
    
      public interface Listener {
        void sessionGranted(OAuthSession session);
      }
    
      @Override public void close() {
        if (mockWebServer == null) throw new IllegalStateException();
        try {
          mockWebServer.close();
        } catch (IOException ignored) {
        }
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 3.8K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/LoggingInterceptors.java

        Request request = new Request.Builder()
            .url("https://publicobject.com/helloworld.txt")
            .build();
    
        Response response = client.newCall(request).execute();
        response.body().close();
      }
    
      private static class LoggingInterceptor implements Interceptor {
        @Override public Response intercept(Chain chain) throws IOException {
          long t1 = System.nanoTime();
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jan 01 15:55:32 GMT 2016
    - 2K bytes
    - Viewed (0)
  6. samples/slack/src/main/java/okhttp3/slack/RtmSession.java

        webSocket.close(1000, null);
        System.out.println("onClose (" + code + "): " + reason);
      }
    
      @Override public void onFailure(WebSocket webSocket, Throwable t, Response response) {
        // TODO(jwilson): can I read the response body? Do I have to?
        System.out.println("onFailure " + response);
      }
    
      @Override public void close() throws IOException {
        if (webSocket == null) return;
    
    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)
  7. samples/guide/src/main/java/okhttp3/recipes/PostStreamingWithPipe.java

              for (int i = 2; i <= 997; i++) {
                System.out.println(i);
                Thread.sleep(10);
                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;
    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. samples/guide/src/main/java/okhttp3/recipes/RequestBodyCompression.java

            }
    
            @Override public void writeTo(BufferedSink sink) throws IOException {
              BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
              body.writeTo(gzipSink);
              gzipSink.close();
            }
          };
        }
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 3.8K bytes
    - Viewed (0)
Back to top