Class SimpleTCP.Acceptor

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

    protected class SimpleTCP.Acceptor
    extends java.lang.Object
    implements java.lang.Runnable
    Calls ServerSocket.accept() and creates new Connection objects
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.net.InetAddress bind  
      protected int port  
      protected Runner runner  
    • Constructor Summary

      Constructors 
      Constructor Description
      Acceptor​(java.net.InetAddress bind, int port)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      protected void start()  
      protected void stop()  
      • Methods inherited from class java.lang.Object

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

      • bind

        protected final java.net.InetAddress bind
      • port

        protected final int port
      • runner

        protected Runner runner
    • Constructor Detail

      • Acceptor

        public Acceptor​(java.net.InetAddress bind,
                        int port)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • start

        protected void start()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        protected void stop()
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable