Package com.sun.akuma

Class EchoServer


  • public class EchoServer
    extends NetworkServer
    Sample echo server.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • EchoServer

        public EchoServer​(java.lang.String[] args)
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • shouldBeDaemonized

        protected boolean shouldBeDaemonized()
        Daemonize if something is given as arguments.
        Overrides:
        shouldBeDaemonized in class NetworkServer
      • frontend

        protected void frontend()
                         throws java.lang.Exception
        Description copied from class: NetworkServer
        Front-end.
        Overrides:
        frontend in class NetworkServer
        Throws:
        java.lang.Exception
      • createServerSocket

        protected java.net.ServerSocket createServerSocket()
                                                    throws java.lang.Exception
        Description copied from class: NetworkServer
        Creates a bound ServerSocket that will be shared by all worker processes. This method is called in the frontend process.
        Specified by:
        createServerSocket in class NetworkServer
        Throws:
        java.lang.Exception
      • worker

        protected void worker​(java.net.ServerSocket ss)
                       throws java.lang.Exception
        Description copied from class: NetworkServer
        Worker thread main code.
        Specified by:
        worker in class NetworkServer
        Parameters:
        ss - The server socket that the frontend process created.
        Throws:
        java.lang.Exception