Class NioBaseServer

    • Field Detail

      • selector

        protected java.nio.channels.Selector selector
      • acceptor

        protected java.lang.Thread acceptor
      • reg_lock

        protected final java.util.concurrent.locks.Lock reg_lock
      • registration

        protected volatile boolean registration
      • max_send_buffers

        protected int max_send_buffers
      • num_selects

        protected int num_selects
      • copy_on_partial_write

        protected boolean copy_on_partial_write
      • reader_idle_time

        protected long reader_idle_time
    • Method Detail

      • maxSendBuffers

        public int maxSendBuffers()
      • maxSendBuffers

        public NioBaseServer maxSendBuffers​(int num)
      • selectorOpen

        public boolean selectorOpen()
      • acceptorRunning

        public boolean acceptorRunning()
      • numSelects

        public int numSelects()
      • copyOnPartialWrite

        public boolean copyOnPartialWrite()
      • readerIdleTime

        public long readerIdleTime()
      • readerIdleTime

        public NioBaseServer readerIdleTime​(long t)
      • copyOnPartialWrite

        public NioBaseServer copyOnPartialWrite​(boolean b)
      • numPartialWrites

        public int numPartialWrites()
      • printBuffers

        public java.lang.String printBuffers()
        Prints send and receive buffers for all connections
      • register

        protected java.nio.channels.SelectionKey register​(java.nio.channels.SelectableChannel ch,
                                                          int interest_ops,
                                                          NioConnection conn)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createConnection

        protected NioConnection createConnection​(Address dest)
                                          throws java.lang.Exception
        Description copied from class: BaseServer
        Creates a new connection object to target dest, but doesn't yet connect it
        Specified by:
        createConnection in class BaseServer
        Throws:
        java.lang.Exception
      • handleAccept

        protected void handleAccept​(java.nio.channels.SelectionKey key)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • acceptorDone

        protected void acceptorDone()