org.apache.hc.client5.http.socket

## Class PlainConnectionSocketFactory

- java.lang.Object
- - org.apache.hc.client5.http.socket.PlainConnectionSocketFactory

- All Implemented Interfaces:
    ConnectionSocketFactory

  Deprecated.
  Use `DetachedSocketFactory`. Please note this interface is considered internal.

      @Deprecated
       @Contract(threading=STATELESS)
      public class PlainConnectionSocketFactory
      extends Object
      implements ConnectionSocketFactory

  The default class for creating plain (unencrypted) sockets.
  See Also:
    `DefaultHttpClientConnectionOperator`, `DetachedSocketFactory`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PlainConnectionSocketFactory` | `INSTANCE` Deprecated. Default instance of `PlainConnectionSocketFactory`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlainConnectionSocketFactory()` Deprecated.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Socket` | `connectSocket(org.apache.hc.core5.util.TimeValue connectTimeout, Socket socket, org.apache.hc.core5.http.HttpHost host, InetSocketAddress remoteAddress, InetSocketAddress localAddress, org.apache.hc.core5.http.protocol.HttpContext context)` Deprecated. Connects the socket to the target host with the given resolved remote address.
    `Socket` | `createSocket(org.apache.hc.core5.http.protocol.HttpContext context)` Deprecated. Creates new, unconnected socket.
    `Socket` | `createSocket(Proxy proxy, org.apache.hc.core5.http.protocol.HttpContext context)` Deprecated. Creates new, unconnected socket via a proxy (generally SOCKS is expected).
    `static PlainConnectionSocketFactory` | `getSocketFactory()` Deprecated.

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

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

    - ### Methods inherited from interface org.apache.hc.client5.http.socket.ConnectionSocketFactory

      `connectSocket`

- - ### Field Detail

    - #### INSTANCE

          public static final PlainConnectionSocketFactory INSTANCE

      Deprecated.
      Default instance of `PlainConnectionSocketFactory`.

  - ### Constructor Detail

    - #### PlainConnectionSocketFactory

          public PlainConnectionSocketFactory()

      Deprecated.

  - ### Method Detail

    - #### getSocketFactory

          public static PlainConnectionSocketFactory getSocketFactory()

      Deprecated.

    - #### createSocket

          public Socket createSocket(Proxy proxy,
                                     org.apache.hc.core5.http.protocol.HttpContext context)
                              throws IOException

      Deprecated.
      Description copied from interface: `ConnectionSocketFactory`
      Creates new, unconnected socket via a proxy (generally SOCKS is expected). The socket should subsequently be passed to `connectSocket` method.
      Specified by:
        `createSocket` in interface `ConnectionSocketFactory`
      Throws:
        `IOException`

    - #### createSocket

          public Socket createSocket(org.apache.hc.core5.http.protocol.HttpContext context)
                              throws IOException

      Deprecated.
      Description copied from interface: `ConnectionSocketFactory`
      Creates new, unconnected socket. The socket should subsequently be passed to `connectSocket` method.
      Specified by:
        `createSocket` in interface `ConnectionSocketFactory`
      Throws:
        `IOException`

    - #### connectSocket

          public Socket connectSocket(org.apache.hc.core5.util.TimeValue connectTimeout,
                                      Socket socket,
                                      org.apache.hc.core5.http.HttpHost host,
                                      InetSocketAddress remoteAddress,
                                      InetSocketAddress localAddress,
                                      org.apache.hc.core5.http.protocol.HttpContext context)
                               throws IOException

      Deprecated.
      Description copied from interface: `ConnectionSocketFactory`
      Connects the socket to the target host with the given resolved remote address.
      Specified by:
        `connectSocket` in interface `ConnectionSocketFactory`
      Parameters:
        `connectTimeout` - connect timeout.
        `socket` - the socket to connect, as obtained from `ConnectionSocketFactory.createSocket(HttpContext)`. `null` indicates that a new socket should be created and connected.
        `host` - target host as specified by the caller (end user).
        `remoteAddress` - the resolved remote address to connect to.
        `localAddress` - the local address to bind the socket to, or `null` for any.
        `context` - the actual HTTP context.
      Returns:
        the connected socket. The returned object may be different from the `sock` argument if this factory supports a layered protocol.
      Throws:
        `IOException` - if an I/O error occurs

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