| java.lang.Object org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory
DefaultProtocolSocketFactory | public class DefaultProtocolSocketFactory implements ProtocolSocketFactory(Code) | | The default class for creating protocol sockets. This class just uses the
java.net.Socket socket constructors.
author: Michael Becke since: 2.0 |
DefaultProtocolSocketFactory | public DefaultProtocolSocketFactory()(Code) | | Constructor for DefaultProtocolSocketFactory.
|
createSocket | public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException(Code) | | Attempts to get a new socket connection to the given host within the given time limit.
This method employs several techniques to circumvent the limitations of older JREs that
do not support connect timeout. When running in JRE 1.4 or above reflection is used to
call Socket#connect(SocketAddress endpoint, int timeout) method. When executing in older
JREs a controller thread is executed. The controller thread attempts to create a new socket
within the given limit of time. If socket constructor does not return until the timeout
expires, the controller terminates and throws an
ConnectTimeoutException
Parameters: host - the host name/IP Parameters: port - the port on the host Parameters: localAddress - the local host name/IP to bind the socket to Parameters: localPort - the port on the local machine Parameters: params - HttpConnectionParams Http connection parameters Socket a new socket throws: IOException - if an I/O error occurs while creating the socket throws: UnknownHostException - if the IP address of the host cannot bedetermined throws: ConnectTimeoutException - if socket cannot be connected within thegiven time limit since: 3.0 |
equals | public boolean equals(Object obj)(Code) | | All instances of DefaultProtocolSocketFactory are the same.
|
getSocketFactory | static DefaultProtocolSocketFactory getSocketFactory()(Code) | | Gets an singleton instance of the DefaultProtocolSocketFactory.
a DefaultProtocolSocketFactory |
hashCode | public int hashCode()(Code) | | All instances of DefaultProtocolSocketFactory have the same hash code.
|
|
|