Class SimpleSocketServer

  • All Implemented Interfaces:
    java.lang.Runnable

    public class SimpleSocketServer
    extends java.lang.Object
    implements java.lang.Runnable
    • Constructor Detail

      • SimpleSocketServer

        public SimpleSocketServer​(int ports)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • newClientHandler

        protected AbstractClientHandler newClientHandler​(java.net.Socket socket)
        Factory method for creating the new AbstractClientHandler for handling requests. This method is invoked in the run method and can be overridden so users can provide their own version of a new new AbstractClientHandler for custom handling requests.
        Parameters:
        socket - the socket
        Returns:
        the new AbstractClientHandler for handling requests.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable