danbikel.util
Class TimeoutServerSocket
java.lang.Object
java.net.ServerSocket
danbikel.util.TimeoutServerSocket
public class TimeoutServerSocket
- extends ServerSocket
A ServerSocket
subclass that delivers Socket
objects via its implementation of accept()
that have
had their timeout values set to the value specified at construction.
Constructor Summary |
TimeoutServerSocket(int timeout,
int port)
Constructs a server socket on the specified port, that
delivers sockets with the specified timeout value via the
accept() method. |
Method Summary |
Socket |
accept()
Creates a socket with the timeout value specified at construction,
then calls ServerSocket.implAccept to wait for a
connection. |
Methods inherited from class java.net.ServerSocket |
bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString |
TimeoutServerSocket
public TimeoutServerSocket(int timeout,
int port)
throws IOException
- Constructs a server socket on the specified port, that
delivers sockets with the specified timeout value via the
accept()
method.
- Throws:
IOException
accept
public Socket accept()
throws IOException
- Creates a socket with the timeout value specified at construction,
then calls
ServerSocket.implAccept
to wait for a
connection.
- Overrides:
accept
in class ServerSocket
- Throws:
IOException
Author: Dan Bikel.