Class HttpMirrorServer

  • All Implemented Interfaces:
    Runnable, Stoppable

    public class HttpMirrorServer
    extends Thread
    implements Stoppable
    Server daemon thread. Creates main socket and listens on it. For each client request, creates a thread to handle the request.
    • Constructor Detail

      • HttpMirrorServer

        public HttpMirrorServer​(int port)
        Create a new Daemon with the specified port and target.
        Parameters:
        port - the port to listen on.
      • HttpMirrorServer

        public HttpMirrorServer​(int port,
                                int maxThreadPoolSize,
                                int maxQueueSize)
        Create a new Daemon with the specified port and target.
        Parameters:
        port - the port to listen on.
        maxThreadPoolSize - Max Thread pool size
        maxQueueSize - Max Queue size
    • Method Detail

      • run

        public void run()
        Listen on the daemon port and handle incoming requests. This method will not exit until stopServer() is called or an error occurs.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • stopServer

        public void stopServer()
        Description copied from interface: Stoppable
        Stop server
        Specified by:
        stopServer in interface Stoppable
      • getException

        public Exception getException()
      • main

        public static void main​(String[] args)