Most visited

Recently visited

Added in API level 1
Deprecated since API level 22

LayeredSocketFactory

public interface LayeredSocketFactory
implements SocketFactory

org.apache.http.conn.scheme.LayeredSocketFactory
Known Indirect Subclasses


该接口在API级别22中已被弃用。
请改用openConnection() 请访问this webpage了解更多详情。

用于分层套接字(SSL / TLS)的SocketFactory 在实现套接字工厂时请参阅此处以了解要考虑的事项。

Summary

Public methods

abstract Socket createSocket(Socket socket, String host, int port, boolean autoClose)

返回连接到分层到现有套接字上的给定主机的套接字。

Inherited methods

From interface org.apache.http.conn.scheme.SocketFactory

Public methods

createSocket

Added in API level 1
Socket createSocket (Socket socket, 
                String host, 
                int port, 
                boolean autoClose)

返回连接到分层到现有套接字上的给定主机的套接字。 主要用于通过代理创建安全套接字。

Parameters
socket Socket: the existing socket
host String: the host name/IP
port int: the port on the host
autoClose boolean: a flag for closing the underling socket when the created socket is closed
Returns
Socket Socket a new socket
Throws
IOException if an I/O error occurs while creating the socket
UnknownHostException if the IP address of the host cannot be determined

Hooray!