org.apache.hc.core5.http.impl.io

## Class SocketHolder

- java.lang.Object
- - org.apache.hc.core5.http.impl.io.SocketHolder

-     public class SocketHolder
      extends Object

  Utility class that holds a `Socket` along with copies of its `InputStream` and `OutputStream`.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SocketHolder(Socket socket)`
    `SocketHolder(SSLSocket sslSocket, Socket baseSocket)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Socket` | `getBaseSocket()`
    `InputStream` | `getInputStream()`
    `protected InputStream` | `getInputStream(Socket socket)`
    `OutputStream` | `getOutputStream()`
    `protected OutputStream` | `getOutputStream(Socket socket)`
    `Socket` | `getSocket()`
    `SSLSocket` | `getSSLSocket()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SocketHolder

          public SocketHolder(SSLSocket sslSocket,
                              Socket baseSocket)

      Since:
        5.3

    - #### SocketHolder

          public SocketHolder(Socket socket)

  - ### Method Detail

    - #### getSocket

          public final Socket getSocket()

    - #### getBaseSocket

          @Internal
          public Socket getBaseSocket()

      Since:
        5.3

    - #### getSSLSocket

          @Internal
          public SSLSocket getSSLSocket()

      Since:
        5.3

    - #### getInputStream

          public final InputStream getInputStream()
                                           throws IOException

      Throws:
        `IOException`

    - #### getInputStream

          protected InputStream getInputStream(Socket socket)
                                        throws IOException

      Throws:
        `IOException`

    - #### getOutputStream

          protected OutputStream getOutputStream(Socket socket)
                                          throws IOException

      Throws:
        `IOException`

    - #### getOutputStream

          public final OutputStream getOutputStream()
                                             throws IOException

      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.