Class NioController

    • Field Detail

      • selectorPoolSize

        protected int selectorPoolSize
        Reactor count
    • Method Detail

      • setSelectorPoolSize

        public void setSelectorPoolSize​(int selectorPoolSize)
      • start0

        protected void start0()
                       throws java.io.IOException
        Specified by:
        start0 in class AbstractController
        Throws:
        java.io.IOException
      • initialSelectorManager

        protected void initialSelectorManager()
                                       throws java.io.IOException
        Start selector manager
        Throws:
        java.io.IOException
      • doStart

        protected abstract void doStart()
                                 throws java.io.IOException
        Inner startup
        Throws:
        java.io.IOException
      • onRead

        public void onRead​(java.nio.channels.SelectionKey key)
        Read event occured
        Specified by:
        onRead in interface SelectionKeyHandler
      • onWrite

        public void onWrite​(java.nio.channels.SelectionKey key)
        Writable event occured
        Specified by:
        onWrite in interface SelectionKeyHandler
      • dispatchReadEvent

        protected abstract void dispatchReadEvent​(java.nio.channels.SelectionKey key)
        Dispatch read event
        Parameters:
        key -
      • dispatchWriteEvent

        protected abstract void dispatchWriteEvent​(java.nio.channels.SelectionKey key)
        Dispatch write event
        Parameters:
        key -
      • stop0

        protected void stop0()
                      throws java.io.IOException
        Specified by:
        stop0 in class AbstractController
        Throws:
        java.io.IOException
      • bind

        public void bind​(int port)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • buildSessionConfig

        protected final NioSessionConfig buildSessionConfig​(java.nio.channels.SelectableChannel sc,
                                                            java.util.Queue<WriteMessage> queue)
        Build nio session config
        Parameters:
        sc -
        queue -
        Returns: