Class FD_SOCK.ServerSocketHandler

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

    protected class FD_SOCK.ServerSocketHandler
    extends java.lang.Object
    implements java.lang.Runnable
    Handles the server-side of a client-server socket connection. Waits until a client connects, and then loops until that client closes the connection. Note that there is no new thread spawned for the listening on the client socket, therefore there can only be 1 client connection at the same time. Subsequent clients attempting to create a connection will be blocked until the first client closes its connection. This should not be a problem as the ring nature of the FD_SOCK protocol always has only 1 client connect to its right-hand-side neighbor.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ServerSocketHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getName()  
      void run()
      Only accepts 1 client connection at a time (saving threads)
      protected void start()  
      protected void stop​(boolean graceful)  
      • Methods inherited from class java.lang.Object

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

      • ServerSocketHandler

        protected ServerSocketHandler()
    • Method Detail

      • getName

        protected java.lang.String getName()
      • start

        protected void start()
      • stop

        protected void stop​(boolean graceful)
      • run

        public void run()
        Only accepts 1 client connection at a time (saving threads)
        Specified by:
        run in interface java.lang.Runnable