Top Description Methods
org.apache.hc.client5.http.socket

public Interface LayeredConnectionSocketFactory

extends ConnectionSocketFactory
Known Direct Implementers
org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory
Annotations
@Contract
threading:STATELESS
Imports
java.io.IOException, java.net.Socket, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.protocol.HttpContext

Extended ConnectionSocketFactory interface for layered sockets such as SSL/TLS.
Since
4.3

Method Summary

Modifier and TypeMethod and Description
public Socket

Returns:

Socket a new socket
createLayeredSocket
(Socket
the existing socket
socket
,
String
the name of the target host.
target
,
int
the port to connect to on the target host.
port
,
HttpContext
the actual HTTP context.
context
)

Returns a socket connected to the given host that is layered over an existing socket.

public default Socket

Returns:

Socket a new socket
createLayeredSocket
(Socket
the existing socket
socket
,
String
the name of the target host.
target
,
int
the port to connect to on the target host.
port
,
Object
connect request attachment.
attachment
,
HttpContext
the actual HTTP context.
context
)

Returns a socket connected to the given host that is layered over an existing socket.

Inherited from org.apache.hc.client5.http.socket.ConnectionSocketFactory:
connectSocketconnectSocketcreateSocketcreateSocket

Method Detail

createLayeredSocketback to summary
public Socket createLayeredSocket(Socket socket, String target, int port, HttpContext context) throws IOException

Returns a socket connected to the given host that is layered over an existing socket. Used primarily for creating secure sockets through proxies.

Parameters
socket:Socket

the existing socket

target:String

the name of the target host.

port:int

the port to connect to on the target host.

context:HttpContext

the actual HTTP context.

Returns:Socket

Socket a new socket

Exceptions
IOException:
if an I/O error occurs while creating the socket
createLayeredSocketback to summary
public default Socket createLayeredSocket(Socket socket, String target, int port, Object attachment, HttpContext context) throws IOException

Returns a socket connected to the given host that is layered over an existing socket. Used primarily for creating secure sockets through proxies.

Parameters
socket:Socket

the existing socket

target:String

the name of the target host.

port:int

the port to connect to on the target host.

attachment:Object

connect request attachment.

context:HttpContext

the actual HTTP context.

Returns:Socket

Socket a new socket

Exceptions
IOException:
if an I/O error occurs while creating the socket
Since
5.2