org.apache.commons.httpclient.protocol
public final class ControllerThreadSocketFactory extends Object
Since: 3.0
Nested Class Summary | |
---|---|
abstract static class | ControllerThreadSocketFactory.SocketTask
Helper class for wrapping socket based tasks. |
Method Summary | |
---|---|
static Socket | createSocket(ProtocolSocketFactory socketfactory, String host, int port, InetAddress localAddress, int localPort, int timeout)
This method spawns a controller thread overseeing the process of socket
initialisation. |
static Socket | createSocket(ControllerThreadSocketFactory.SocketTask task, int timeout) |
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 timeout the timeout value to be used in milliseconds. If the socket cannot be completed within the given time limit, it will be abandoned
Returns: a connected 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