com.alien.enterpriseRFID.reader
Class TimedSocket
java.lang.Object
com.alien.enterpriseRFID.reader.TimedSocket
- public class TimedSocket
- extends java.lang.Object
This class offers a timeout feature on socket connections. A maximum length
of time allowed for opening 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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TimedSocket
public 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