Class KQSelector

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    class KQSelector
    extends java.nio.channels.spi.AbstractSelector
    An implementation of a Selector that uses the BSD (including MacOS) kqueue(2) mechanism
    • Method Detail

      • implCloseSelector

        protected void implCloseSelector()
                                  throws java.io.IOException
        Specified by:
        implCloseSelector in class java.nio.channels.spi.AbstractSelector
        Throws:
        java.io.IOException
      • register

        protected java.nio.channels.SelectionKey register​(java.nio.channels.spi.AbstractSelectableChannel ch,
                                                          int ops,
                                                          java.lang.Object att)
        Specified by:
        register in class java.nio.channels.spi.AbstractSelector
      • keys

        public java.util.Set<java.nio.channels.SelectionKey> keys()
        Specified by:
        keys in class java.nio.channels.Selector
      • selectedKeys

        public java.util.Set<java.nio.channels.SelectionKey> selectedKeys()
        Specified by:
        selectedKeys in class java.nio.channels.Selector
      • selectNow

        public int selectNow()
                      throws java.io.IOException
        Specified by:
        selectNow in class java.nio.channels.Selector
        Throws:
        java.io.IOException
      • select

        public int select​(long timeout)
                   throws java.io.IOException
        Specified by:
        select in class java.nio.channels.Selector
        Throws:
        java.io.IOException
      • select

        public int select()
                   throws java.io.IOException
        Specified by:
        select in class java.nio.channels.Selector
        Throws:
        java.io.IOException
      • poll

        private int poll​(long timeout)
      • handleCancelledKeys

        private int handleCancelledKeys()
      • wakeupReceived

        private void wakeupReceived()
      • wakeup

        public java.nio.channels.Selector wakeup()
        Specified by:
        wakeup in class java.nio.channels.Selector