org.apache.hc.core5.http.io

## Interface HttpConnectionFactory<T extends 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)`
    `default T` | `createConnection(SSLSocket sslSocket, Socket socket)` Create TLS connection with a `SSLSocket` layered over a plain `Socket`.

- - ### Method Detail

    - #### createConnection

          T createConnection(Socket socket)
                      throws IOException

      Throws:
        `IOException`

    - #### createConnection

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

      Create 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.
      Throws:
        `IOException`
      Since:
        5.3

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