org.jnp.interfaces
Class TimedSocketFactory
java.lang.Object
javax.net.SocketFactory
org.jnp.interfaces.TimedSocketFactory
- public class TimedSocketFactory
- extends javax.net.SocketFactory
A concrete implementation of the SocketFactory that supports a configurable
timeout for the initial socket connection as well as the SO_TIMEOUT used to
determine how long a read will block waiting for data.
Method Summary |
java.net.Socket |
createSocket(java.net.InetAddress hostAddr,
int port)
|
java.net.Socket |
createSocket(java.net.InetAddress hostAddr,
int port,
java.net.InetAddress localAddr,
int localPort)
|
protected java.net.Socket |
createSocket(java.net.InetAddress hostAddr,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectTimeout)
|
java.net.Socket |
createSocket(java.lang.String host,
int port)
|
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
|
Methods inherited from class javax.net.SocketFactory |
createSocket, getDefault |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JNP_TIMEOUT
public static final java.lang.String JNP_TIMEOUT
- See Also:
- Constant Field Values (src)
JNP_SO_TIMEOUT
public static final java.lang.String JNP_SO_TIMEOUT
- See Also:
- Constant Field Values (src)
timeout
protected int timeout
- The connection timeout in milliseconds
soTimeout
protected int soTimeout
- The SO_TIMEOUT in milliseconds
TimedSocketFactory
public TimedSocketFactory()
- Creates a new instance of TimedSocketFactory
TimedSocketFactory
public TimedSocketFactory(java.util.Hashtable env)
createSocket
public java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException,
java.net.UnknownHostException
- Throws:
java.io.IOException
java.net.UnknownHostException
createSocket
public java.net.Socket createSocket(java.net.InetAddress hostAddr,
int port)
throws java.io.IOException
- Throws:
java.io.IOException
createSocket
public java.net.Socket createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
throws java.io.IOException,
java.net.UnknownHostException
- Throws:
java.io.IOException
java.net.UnknownHostException
createSocket
public java.net.Socket createSocket(java.net.InetAddress hostAddr,
int port,
java.net.InetAddress localAddr,
int localPort)
throws java.io.IOException
- Throws:
java.io.IOException
createSocket
protected java.net.Socket createSocket(java.net.InetAddress hostAddr,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectTimeout)
throws java.io.IOException
- Throws:
java.io.IOException