org.apache.commons.httpclient.protocol
public final class ControllerThreadSocketFactory extends java.lang.Object
ConnectTimeoutException| Modifier and Type | Class and Description |
|---|---|
static class |
ControllerThreadSocketFactory.SocketTask
Helper class for wrapping socket based tasks.
|
| Modifier and Type | Method and Description |
|---|---|
static java.net.Socket |
createSocket(ControllerThreadSocketFactory.SocketTask task,
int timeout) |
static java.net.Socket |
createSocket(ProtocolSocketFactory socketfactory,
java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort,
int timeout)
This method spawns a controller thread overseeing the process of socket
initialisation.
|
public static java.net.Socket createSocket(ProtocolSocketFactory socketfactory, java.lang.String host, int port, java.net.InetAddress localAddress, int localPort, int timeout) throws java.io.IOException, java.net.UnknownHostException, ConnectTimeoutException
ConnectTimeoutExceptionhost - the host name/IPport - the port on the hostlocalAddress - the local host name/IP to bind the socket tolocalPort - the port on the local machinetimeout - the timeout value to be used in milliseconds. If the socket cannot be
completed within the given time limit, it will be abandonedjava.io.IOException - if an I/O error occurs while creating the socketjava.net.UnknownHostException - if the IP address of the host cannot be
determinedConnectTimeoutException - if socket cannot be connected within the
given time limitpublic static java.net.Socket createSocket(ControllerThreadSocketFactory.SocketTask task, int timeout) throws java.io.IOException, java.net.UnknownHostException, ConnectTimeoutException
java.io.IOExceptionjava.net.UnknownHostExceptionConnectTimeoutException