Class Server.ServerThread

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    Server

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

      • Nested classes/interfaces inherited from class java.lang.Thread

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

      Fields 
      Modifier and Type Field Description
      private java.net.Socket connection  
      private Server.ConnectionIndex connectionIndex  
      private java.io.ObjectInputStream input  
      private java.io.ObjectOutputStream output  
      private java.lang.Object readObject  
      private boolean stop  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      ServerThread​(java.net.Socket socket, Server parentServer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      Server.ConnectionIndex getConnectionIndex()  
      java.lang.Object read()  
      void run()  
      void send​(java.lang.Object obj)  
      void setConnectionIndex​(Server.ConnectionIndex connectionIndex)  
      private void setupStreams()  
      • 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
    • Field Detail

      • connection

        private java.net.Socket connection
      • output

        private java.io.ObjectOutputStream output
      • input

        private java.io.ObjectInputStream input
      • readObject

        private java.lang.Object readObject
      • stop

        private volatile boolean stop
    • Constructor Detail

      • ServerThread

        public ServerThread​(java.net.Socket socket,
                            Server parentServer)
    • Method Detail

      • read

        public java.lang.Object read()
      • run

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

        public void send​(java.lang.Object obj)
      • close

        public void close()
      • setupStreams

        private void setupStreams()
      • setConnectionIndex

        public void setConnectionIndex​(Server.ConnectionIndex connectionIndex)
        Parameters:
        connectionIndex - the connectionIndex to set