org.apache.commons.httpclient.protocol
public interface ProtocolSocketFactory
Both {@link java.lang.Object#equals(java.lang.Object) Object.equals()} and
{@link java.lang.Object#hashCode() Object.hashCode()} should be overridden appropriately.
Protocol socket factories are used to uniquely identify Protocol
s and
HostConfiguration
s, and equals()
and hashCode()
are
required for the correct operation of some connection managers.
Since: 2.0
Method Summary | |
---|---|
Socket | createSocket(String host, int port, InetAddress localAddress, int localPort)
Gets a new socket connection to the given host.
|
Socket | createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params)
Gets a new socket connection to the given host.
|
Socket | createSocket(String host, int port)
Gets a new socket connection to the given host.
|
Parameters: host the host name/IP port the port on the host localAddress the local host name/IP to bind the socket to localPort the port on the local machine
Returns: 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
Parameters: host the host name/IP port the port on the host localAddress the local host name/IP to bind the socket to localPort the port on the local machine params {@link HttpConnectionParams Http connection parameters}
Returns: 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 ConnectTimeoutException if socket cannot be connected within the given time limit
Since: 3.0
Parameters: host the host name/IP port the port on the host
Returns: 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