@Contract(threading=STATELESS) public class PlainConnectionSocketFactory extends Object implements ConnectionSocketFactory
| 限定符和类型 | 字段和说明 |
|---|---|
static PlainConnectionSocketFactory |
INSTANCE |
| 构造器和说明 |
|---|
PlainConnectionSocketFactory() |
| 限定符和类型 | 方法和说明 |
|---|---|
Socket |
connectSocket(TimeValue connectTimeout,
Socket socket,
HttpHost host,
InetSocketAddress remoteAddress,
InetSocketAddress localAddress,
HttpContext context)
Connects the socket to the target host with the given resolved remote address.
|
Socket |
createSocket(HttpContext context)
Creates new, unconnected socket.
|
static PlainConnectionSocketFactory |
getSocketFactory() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectSocketpublic static final PlainConnectionSocketFactory INSTANCE
public static PlainConnectionSocketFactory getSocketFactory()
public Socket createSocket(HttpContext context) throws IOException
ConnectionSocketFactoryconnectSocket method.createSocket 在接口中 ConnectionSocketFactoryIOException - if an I/O error occurs while creating the socketpublic Socket connectSocket(TimeValue connectTimeout, Socket socket, HttpHost host, InetSocketAddress remoteAddress, InetSocketAddress localAddress, HttpContext context) throws IOException
ConnectionSocketFactoryconnectSocket 在接口中 ConnectionSocketFactoryconnectTimeout - 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.sock argument if this factory supports
a layered protocol.IOException - if an I/O error occursCopyright © 2023. All rights reserved.