Package jnr.enxio.channels
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 class
private static final class
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final jnr.ffi.Pointer
private static final boolean
private final Map<Integer,
KQSelector.Descriptor> private static final int
private static final int
private static final int
private static final int
private static final int
private final jnr.ffi.Pointer
private static final int
private static final int
private final KQSelector.EventIO
private int
private static final int
private final int[]
private final Object
private final jnr.ffi.Runtime
private final Set<SelectionKey>
private final Native.Timespec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
private void
handleChangedKey
(KQSelector.Descriptor changed) protected void
(package private) void
interestOps
(KQSelectionKey k, int ops) keys()
private int
poll
(long timeout) protected SelectionKey
register
(AbstractSelectableChannel ch, int ops, Object att) int
select()
int
select
(long timeout) int
wakeup()
private void
Methods inherited from class java.nio.channels.spi.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:
implCloseSelector
in classAbstractSelector
- Throws:
IOException
-
register
- Specified by:
register
in classAbstractSelector
-
keys
-
selectedKeys
- Specified by:
selectedKeys
in classSelector
-
selectNow
- Specified by:
selectNow
in classSelector
- Throws:
IOException
-
select
- Specified by:
select
in classSelector
- Throws:
IOException
-
select
- Specified by:
select
in classSelector
- Throws:
IOException
-
poll
private int poll(long timeout) -
handleCancelledKeys
private int handleCancelledKeys() -
handleChangedKey
-
wakeupReceived
private void wakeupReceived() -
wakeup
-
interestOps
-