org.jnp.interfaces
Class TimedSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by org.jnp.interfaces.TimedSocketFactory

public class TimedSocketFactory
extends 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.

Version:
$Revision: 1.2.16.1 $
Author:
Scott.Stark@jboss.org

Field Summary
static String JNP_SO_TIMEOUT
           
static String JNP_TIMEOUT
           
protected  int soTimeout
          The SO_TIMEOUT in milliseconds
protected  int timeout
          The connection timeout in milliseconds
 
Constructor Summary
TimedSocketFactory()
          Creates a new instance of TimedSocketFactory
TimedSocketFactory(Hashtable env)
           
 
Method Summary
 Socket createSocket(InetAddress hostAddr, int port)
           
 Socket createSocket(InetAddress hostAddr, int port, InetAddress localAddr, int localPort)
           
protected  Socket createSocket(InetAddress hostAddr, int port, InetAddress localAddr, int localPort, int connectTimeout)
           
 Socket createSocket(String host, int port)
           
 Socket createSocket(String host, int port, 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
 

Field Detail

JNP_TIMEOUT

public static final String JNP_TIMEOUT
See Also:
Constant Field Values

JNP_SO_TIMEOUT

public static final String JNP_SO_TIMEOUT
See Also:
Constant Field Values

timeout

protected int timeout
The connection timeout in milliseconds


soTimeout

protected int soTimeout
The SO_TIMEOUT in milliseconds

Constructor Detail

TimedSocketFactory

public TimedSocketFactory()
Creates a new instance of TimedSocketFactory


TimedSocketFactory

public TimedSocketFactory(Hashtable env)
Method Detail

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(InetAddress hostAddr,
                           int port)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress localAddr,
                           int localPort)
                    throws IOException,
                           UnknownHostException
Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(InetAddress hostAddr,
                           int port,
                           InetAddress localAddr,
                           int localPort)
                    throws IOException
Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

protected Socket createSocket(InetAddress hostAddr,
                              int port,
                              InetAddress localAddr,
                              int localPort,
                              int connectTimeout)
                       throws IOException
Throws:
IOException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.