Class KQSelector
java.lang.Object
java.nio.channels.Selector
java.nio.channels.spi.AbstractSelector
jnr.enxio.channels.KQSelector
- All Implemented Interfaces:
Closeable, AutoCloseable
An implementation of a
Selector that uses the BSD (including MacOS)
kqueue(2) mechanism-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static final classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final jnr.ffi.Pointerprivate static final booleanprivate final Map<Integer, KQSelector.Descriptor> private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate final jnr.ffi.Pointerprivate static final intprivate static final intprivate final KQSelector.EventIOprivate intprivate static final intprivate final int[]private final Objectprivate final jnr.ffi.Runtimeprivate final Set<SelectionKey> private final Native.Timespec -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intprivate voidhandleChangedKey(KQSelector.Descriptor changed) protected void(package private) voidinterestOps(KQSelectionKey k, int ops) keys()private intpoll(long timeout) protected SelectionKeyregister(AbstractSelectableChannel ch, int ops, Object att) intselect()intselect(long timeout) intwakeup()private voidMethods inherited from class AbstractSelector
begin, cancelledKeys, close, deregister, end, isOpen, provider
-
Field Details
-
DEBUG
private static final boolean DEBUG- See Also:
-
MAX_EVENTS
private static final int MAX_EVENTS- See Also:
-
EVFILT_READ
private static final int EVFILT_READ- See Also:
-
EVFILT_WRITE
private static final int EVFILT_WRITE- See Also:
-
EV_ADD
private static final int EV_ADD- See Also:
-
EV_DELETE
private static final int EV_DELETE- See Also:
-
EV_ENABLE
private static final int EV_ENABLE- See Also:
-
EV_DISABLE
private static final int EV_DISABLE- See Also:
-
EV_CLEAR
private static final int EV_CLEAR- See Also:
-
kqfd
private int kqfd -
runtime
private final jnr.ffi.Runtime runtime -
changebuf
private final jnr.ffi.Pointer changebuf -
eventbuf
private final jnr.ffi.Pointer eventbuf -
io
-
pipefd
private final int[] pipefd -
regLock
-
descriptors
-
selected
-
ZERO_TIMESPEC
-
-
Constructor Details
-
KQSelector
-
-
Method Details
-
implCloseSelector
- Specified by:
implCloseSelectorin classAbstractSelector- Throws:
IOException
-
register
- Specified by:
registerin classAbstractSelector
-
keys
-
selectedKeys
- Specified by:
selectedKeysin classSelector
-
selectNow
- Specified by:
selectNowin classSelector- Throws:
IOException
-
select
- Specified by:
selectin classSelector- Throws:
IOException
-
select
- Specified by:
selectin classSelector- Throws:
IOException
-
poll
private int poll(long timeout) -
handleCancelledKeys
private int handleCancelledKeys() -
handleChangedKey
-
wakeupReceived
private void wakeupReceived() -
wakeup
-
interestOps
-