com.lukasfeiler.tcpserver
Class TCPServer

java.lang.Object
  extended byjava.net.ServerSocket
      extended bycom.lukasfeiler.tcpserver.TCPServer
Direct Known Subclasses:
HTTPServer

public class TCPServer
extends java.net.ServerSocket


Constructor Summary
TCPServer(int port, java.net.InetAddress bindAddr, int connectionTimeout, int connectionLifetime, int connectionMaximum, int connectionMaximumDelay, int connectionQueueLength)
           
 
Method Summary
 boolean connectionMaximumExceeded()
           
 boolean connectionMaximumReached()
           
 long getConnectionLifetime()
           
 int getConnectionMaximum()
           
 int getConnectionMaximumDelay()
           
 int getConnectionQueueLength()
           
 int getConnectionTimeout()
           
static void main(java.lang.String[] args)
           
 void removeSocket(java.lang.Integer socketId)
           
 TCPSocket socketFactory(java.net.Socket tcpSocket, java.lang.Integer socketId, TCPServer tcpServer, int connectionTimeout)
           
protected  void start()
           
 void stop()
           
 
Methods inherited from class java.net.ServerSocket
accept, bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TCPServer

public TCPServer(int port,
                 java.net.InetAddress bindAddr,
                 int connectionTimeout,
                 int connectionLifetime,
                 int connectionMaximum,
                 int connectionMaximumDelay,
                 int connectionQueueLength)
          throws java.io.IOException
Method Detail

getConnectionTimeout

public int getConnectionTimeout()

getConnectionLifetime

public long getConnectionLifetime()

getConnectionMaximum

public int getConnectionMaximum()

getConnectionMaximumDelay

public int getConnectionMaximumDelay()

getConnectionQueueLength

public int getConnectionQueueLength()

removeSocket

public void removeSocket(java.lang.Integer socketId)

stop

public void stop()

start

protected void start()

socketFactory

public TCPSocket socketFactory(java.net.Socket tcpSocket,
                               java.lang.Integer socketId,
                               TCPServer tcpServer,
                               int connectionTimeout)
                        throws java.io.IOException
Throws:
java.io.IOException

connectionMaximumReached

public boolean connectionMaximumReached()

connectionMaximumExceeded

public boolean connectionMaximumExceeded()

main

public static void main(java.lang.String[] args)