Class SimpleServer

    • Field Detail

      • m_stopped

        protected volatile boolean m_stopped
    • Constructor Detail

      • SimpleServer

        public SimpleServer()
    • Method Detail

      • setBanner

        public void setBanner​(java.lang.String banner)

        setBanner

        Parameters:
        banner - a String object.
      • getBanner

        public java.lang.String getBanner()

        getBanner

        Returns:
        a String object.
      • setBannerDelay

        public void setBannerDelay​(int delay)
        Slow down transmission of the banner by a specified number of milliseconds.
      • getInetAddress

        public java.net.InetAddress getInetAddress()

        getInetAddress

        Returns:
        InetAddress returns the inetaddress from the serversocket.
      • getLocalPort

        public int getLocalPort()

        getLocalPort

        Returns:
        a int.
      • setThreadSleepLength

        public void setThreadSleepLength​(int timeout)

        setThreadSleepLength

        Parameters:
        timeout - a int.
      • getThreadSleepLength

        public int getThreadSleepLength()

        getThreadSleepLength

        Returns:
        a int.
      • init

        public void init()
                  throws java.lang.Exception

        init

        Overrides:
        init in class SimpleConversationEndPoint
        Throws:
        java.lang.Exception - if any.
      • onInit

        protected void onInit()

        onInit

      • startServer

        public void startServer()
                         throws java.io.IOException

        startServer

        Throws:
        java.lang.Exception - if any.
        java.io.IOException
      • stopServer

        public void stopServer()
                        throws java.io.IOException

        stopServer

        Throws:
        java.io.IOException - if any.
      • dispose

        public void dispose()

        dispose

      • getRunnable

        protected SimpleServerRunnable getRunnable()
                                            throws java.io.IOException

        getRunnable

        Returns:
        a Runnable object.
        Throws:
        java.lang.Exception - if any.
        java.io.IOException
      • sendBanner

        protected void sendBanner​(java.io.OutputStream out)
                           throws java.io.IOException

        sendBanner

        Parameters:
        out - a OutputStream object.
        Throws:
        java.io.IOException - if any.
      • attemptConversation

        protected boolean attemptConversation​(java.io.BufferedReader in,
                                              java.io.OutputStream out)
                                       throws java.lang.Exception

        attemptConversation

        Parameters:
        in - a BufferedReader object.
        out - a OutputStream object.
        Returns:
        a boolean.
        Throws:
        java.lang.Exception - if any.
      • addErrorHandler

        protected void addErrorHandler​(RequestHandler requestHandler)

        addErrorHandler

        Parameters:
        requestHandler - a RequestHandler object.
      • errorString

        protected RequestHandler errorString​(java.lang.String error)

        errorString

        Parameters:
        error - a String object.
        Returns:
        a RequestHandler object.
      • shutdownServer

        protected RequestHandler shutdownServer​(java.lang.String response)

        shutdownServer

        Parameters:
        response - a String object.
        Returns:
        a RequestHandler object.
      • setServerSocket

        public void setServerSocket​(java.net.ServerSocket serverSocket)

        setServerSocket

        Parameters:
        serverSocket - a ServerSocket object.
      • getServerSocket

        public java.net.ServerSocket getServerSocket()

        getServerSocket

        Returns:
        a ServerSocket object.
      • setSocket

        public void setSocket​(java.net.Socket socket)

        setSocket

        Parameters:
        socket - a Socket object.
      • getSocket

        public java.net.Socket getSocket()

        getSocket

        Returns:
        a Socket object.
      • setServerThread

        protected void setServerThread​(java.lang.Thread serverThread)

        setServerThread

        Parameters:
        serverThread - a Thread object.
      • getServerThread

        protected java.lang.Thread getServerThread()

        getServerThread

        Returns:
        a Thread object.