private static final class HttpEndpoint.SocketFactoryAdapter extends Object implements HttpClientSocketFactory
Modifier and Type | Field and Description |
---|---|
private Constraints.Distilled |
distilled |
private SocketFactory |
sf |
Constructor and Description |
---|
SocketFactoryAdapter(SocketFactory sf,
Constraints.Distilled distilled) |
Modifier and Type | Method and Description |
---|---|
private Socket |
connectToHost(String host,
int port,
Constraints.Distilled distilled)
Returns a socket connected to the specified host and port,
according to the specified constraints.
|
private Socket |
connectToSocketAddress(SocketAddress socketAddress,
Constraints.Distilled distilled)
Returns a socket connected to the specified address, with a
timeout governed by the specified constraints.
|
Socket |
createSocket(String host,
int port)
Creates client socket connected to the given host and port.
|
Socket |
createTunnelSocket(Socket s)
Creates layered socket on top of given base socket, for use when
tunneling HTTP messages through a proxy.
|
private Socket |
newSocket()
Returns a new unconnected socket, using this endpoint's
socket factory if non-null.
|
private final SocketFactory sf
private final Constraints.Distilled distilled
SocketFactoryAdapter(SocketFactory sf, Constraints.Distilled distilled)
public Socket createSocket(String host, int port) throws IOException
HttpClientSocketFactory
createSocket
in interface HttpClientSocketFactory
IOException
private Socket connectToHost(String host, int port, Constraints.Distilled distilled) throws IOException
IOException
private Socket connectToSocketAddress(SocketAddress socketAddress, Constraints.Distilled distilled) throws IOException
IOException
private Socket newSocket() throws IOException
IOException
public Socket createTunnelSocket(Socket s) throws IOException
HttpClientSocketFactory
createTunnelSocket
in interface HttpClientSocketFactory
IOException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.