Parsing Engine

danbikel.util
Class TimeoutServerSocket

java.lang.Object
  extended by java.net.ServerSocket
      extended by 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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
Method Detail

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

Parsing Engine

Author: Dan Bikel.