se.ericsson.eto.norarc.javaframe
Class TimedSocket
java.lang.Object
se.ericsson.eto.norarc.javaframe.TimedSocket
- class TimedSocket
- extends java.lang.Object
This class offers a timeout feature on socket connections.
A maximum length of time allowed for a connection can be
specified, along with a host and port.
- Author:
- David Reilly
Method Summary |
static java.net.Socket |
getSocket(java.net.InetAddress addr,
int port,
int delay)
Attempts to connect to a service at the specified address
and port, for a specified maximum amount of time. |
static java.net.Socket |
getSocket(java.lang.String host,
int port,
int delay)
Attempts to connect to a service at the specified address
and port, for a specified maximum amount of time. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TimedSocket
TimedSocket()
getSocket
public static java.net.Socket getSocket(java.net.InetAddress addr,
int port,
int delay)
throws java.io.InterruptedIOException,
java.io.IOException
- Attempts to connect to a service at the specified address
and port, for a specified maximum amount of time.
- Parameters:
addr
- Address of hostport
- Port of servicedelay
- Delay in milliseconds
- Throws:
java.io.InterruptedIOException
java.io.IOException
getSocket
public static java.net.Socket getSocket(java.lang.String host,
int port,
int delay)
throws java.io.InterruptedIOException,
java.io.IOException
- Attempts to connect to a service at the specified address
and port, for a specified maximum amount of time.
- Parameters:
host
- Hostname of machineport
- Port of servicedelay
- Delay in milliseconds
- Throws:
java.io.InterruptedIOException
java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception