Class Server

  • All Implemented Interfaces:
    java.lang.Runnable

    public class Server
    extends java.lang.Thread
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  Server.ConnectionIndex  
      class  Server.ServerThread  
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      Server​(int port, int backlog)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      Function<Server.ConnectionIndex,​java.lang.Object> getCallback()  
      int getPort()  
      java.util.ArrayList<Server.ServerThread> getThreads()  
      void run()  
      void setCallback​(Function<Server.ConnectionIndex,​java.lang.Object> callback)  
      void setPort​(int port)  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Server

        public Server​(int port,
                      int backlog)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • close

        public void close()
      • getPort

        public int getPort()
        Returns:
        the port
      • setPort

        public void setPort​(int port)
        Parameters:
        port - the port to set
      • getThreads

        public java.util.ArrayList<Server.ServerThread> getThreads()
        Returns:
        the threads