PATH |
- Inherits from:
- Object
- Package:
- com.webobjects.foundation
This class provides an easy way to get a TCP socket with a connection timeout. The static methods in this class correspond to all of the java.net.Socket constructors. See Sun's documentation for the java.net.Socket class for more information.
Calling getSocketWithTimeout will either return a socket, or will throw an IOException if it times out (because a socket cannot be created). When a new socket is requested with getSocketWithTimeout, the polling interval regulates how often that socket is requested. By default, the polling interval is 100 milliseconds, and can be changed using setPollingInterval. A timeout argument is passed to getSocketWithTimeout, and the socket request times out when a timer that keeps track of the total polling time exceeds the timeout value.
This class only contains static methods. It is never instantiated.
- All methods
- getSocketWithTimeout
- pollingInterval
- setPollingInterval
public static java.net.Socket getSocketWithTimeout( String remoteHost, int remotePort, java.net.InetAddress localInetAddress, int localPort, int timeOut) throws java.net.UnknownHostException, java.io.IOException
public static java.net.Socket getSocketWithTimeout( String remoteHost, int remotePort, int timeout) throws java.net.UnknownHostException, java.io.IOException
public static java.net.Socket getSocketWithTimeout( InetAddress remoteAddress, int remotePort, int timeout) throws java.io.IOException
public static Socket getSocketWithTimeout( InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, int timeout) throws java.io.IOException
public static int pollingInterval()
public static void setPollingInterval(int interval)
© 2001 Apple Computer, Inc. (Last Published April 17, 2001)