public Socket createSocket(String host,
int port,
InetAddress localAddress,
int localPort,
HttpParams params) throws IOException, UnknownHostException {
if (params == null) {
throw new IllegalArgumentException("Parameters may not be null");
}
int timeout = HttpConnectionParams.getConnectionTimeout(params);
if (timeout != 0) {
throw new IllegalStateException("Connection timeout is not supported in old IO mode");
}
if (localAddress != null) {
return new Socket(host, port, localAddress, localPort);
} else {
return new Socket(host, port);
}
}
Attempts to get a new socket connection to using old (pre Java 1.4) IO mode.
This socket factory does not support connect timeout as it requires Java 1.4
functionality. |