org.apache.commons.httpclient.protocol
Class ReflectionSocketFactory
java.lang.Object
org.apache.commons.httpclient.protocol.ReflectionSocketFactory
public final class ReflectionSocketFactory
extends java.lang.Object
This helper class uses refelction in order to execute Socket methods
available in Java 1.4 and above
static Socket | createSocket(String socketfactoryName, String host, int port, InetAddress localAddress, int localPort, int timeout) - This method attempts to execute Socket method available since Java 1.4
using reflection.
|
createSocket
public static Socket createSocket(String socketfactoryName,
String host,
int port,
InetAddress localAddress,
int localPort,
int timeout)
throws IOException,
UnknownHostException,
ConnectTimeoutException
This method attempts to execute Socket method available since Java 1.4
using reflection. If the methods are not available or could not be executed
null is returned
socketfactoryName
- name of the socket factory classhost
- 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 abandoned
Copyright (c) 1999-2005 - Apache Software Foundation