org.apache.hc.core5.http.io

## Interface HttpConnectionFactory<T extends HttpConnection>

- Type Parameters:
    `T` - The type of `HttpConnection`.
  All Known Implementing Classes:
    DefaultBHttpClientConnectionFactory, DefaultBHttpServerConnectionFactory, LoggingBHttpClientConnectionFactory, LoggingBHttpServerConnectionFactory

      public interface HttpConnectionFactory<T extends HttpConnection>

  Factory for `HttpConnection` instances.
  Since:
    4.3

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `createConnection(Socket socket)` Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
    `default T` | `createConnection(SSLSocket sslSocket, Socket socket)` Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.

- - ### Method Detail

    - #### createConnection

          T createConnection(Socket socket)
                      throws IOException

      Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
      Parameters:
        `socket` - the plain socket SSL socket has been layered over.
      Returns:
        a new HttpConnection.
      Throws:
        `IOException` - in case of an I/O error.

    - #### createConnection

          default T createConnection(SSLSocket sslSocket,
                                     Socket socket)
                              throws IOException

      Creates TLS connection with a `SSLSocket` layered over a plain `Socket`.
      Parameters:
        `sslSocket` - the SSL socket. May be `null`.
        `socket` - the plain socket SSL socket has been layered over.
      Returns:
        a new HttpConnection.
      Throws:
        `IOException` - in case of an I/O error.
      Since:
        5.3

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