java.nio.channels.Selector that uses good old
poll(2)
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private PollSelectionKey[] | |
| private final Map | |
| private int | |
| private final int[] | |
| private ByteBuffer | |
| pack-priv static final int | |
| private static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private final Object | |
| private static final int | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private short | |
| private int | |
| private short | |
| protected void | implCloseSelector()
Implements abstract java. |
| pack-priv void | |
| public Set | |
| private int | |
| private void | |
| private void | |
| private void | |
| protected SelectionKey | register(AbstractSelectableChannel
The channel to be registered ch, int The initial interest set, which must be valid ops, Object The initial attachment for the resulting key att)Implements abstract java. |
| private void | |
| public int | select(long
If positive, block for up to timeout)timeout
milliseconds, more or less, while waiting for a
channel to become ready; if zero, block indefinitely;
must not be negativeImplements abstract java. |
| public int | select()
Implements abstract java. |
| public Set | selectedKeys()
Implements abstract java. |
| public int | selectNow()
Implements abstract java. |
| public Selector | wakeup()
Implements abstract java. |
| private void |
| EVENTS_OFFSET | back to summary |
|---|---|
| private static final int EVENTS_OFFSET | |
| FD_OFFSET | back to summary |
|---|---|
| private static final int FD_OFFSET | |
| keyArray | back to summary |
|---|---|
| private PollSelectionKey[] keyArray | |
| keys | back to summary |
|---|---|
| private final Map<SelectionKey, Boolean> keys | |
| nfds | back to summary |
|---|---|
| private int nfds | |
| pipefd | back to summary |
|---|---|
| private final int[] pipefd | |
| pollData | back to summary |
|---|---|
| private ByteBuffer pollData | |
| POLLERR | back to summary |
|---|---|
| pack-priv static final int POLLERR | |
| POLLFD_SIZE | back to summary |
|---|---|
| private static final int POLLFD_SIZE | |
| POLLHUP | back to summary |
|---|---|
| pack-priv static final int POLLHUP | |
| POLLIN | back to summary |
|---|---|
| pack-priv static final int POLLIN | |
| POLLOUT | back to summary |
|---|---|
| pack-priv static final int POLLOUT | |
| regLock | back to summary |
|---|---|
| private final Object regLock | |
| REVENTS_OFFSET | back to summary |
|---|---|
| private static final int REVENTS_OFFSET | |
| selected | back to summary |
|---|---|
| private final Set<SelectionKey> selected | |
| PollSelector | back to summary |
|---|---|
| public PollSelector(SelectorProvider provider) | |
| add | back to summary |
|---|---|
| private void add(PollSelectionKey k) | |
| getPollEvents | back to summary |
|---|---|
| private short getPollEvents(int idx) | |
| getPollFD | back to summary |
|---|---|
| private int getPollFD(int idx) | |
| getPollRevents | back to summary |
|---|---|
| private short getPollRevents(int idx) | |
| implCloseSelector | back to summary |
|---|---|
| protected void implCloseSelector() throws IOException Implements abstract java. Doc from java. Closes this selector. This method is invoked by the An implementation of this method must arrange for any other thread
that is blocked in a selection operation upon this selector to return
immediately as if by invoking the
| |
| interestOps | back to summary |
|---|---|
| pack-priv void interestOps(PollSelectionKey k, int ops) | |
| keys | back to summary |
|---|---|
| public Set Implements abstract java. Doc from java. Returns this selector's key set. The key set is not directly modifiable. A key is removed only after
it has been cancelled and its channel has been deregistered. Any
attempt to modify the key set will cause an The set is safe for use by multiple concurrent threads.
| |
| poll | back to summary |
|---|---|
| private int poll(long timeout) throws IOException | |
| putPollEvents | back to summary |
|---|---|
| private void putPollEvents(int idx, int events) | |
| putPollFD | back to summary |
|---|---|
| private void putPollFD(int idx, int fd) | |
| putPollRevents | back to summary |
|---|---|
| private void putPollRevents(int idx, int events) | |
| register | back to summary |
|---|---|
| protected SelectionKey register(AbstractSelectableChannel ch, int ops, Object att) Implements abstract java. Doc from java. Registers the given channel with this selector. This method is invoked by a channel's
| |
| remove | back to summary |
|---|---|
| private void remove(PollSelectionKey k) | |
| select | back to summary |
|---|---|
| public int select(long timeout) throws IOException Implements abstract java. Doc from java. Selects a set of keys whose corresponding channels are ready for I/O operations. This method performs a blocking selection
operation. It returns only after at least one channel is selected,
this selector's This method does not offer real-time guarantees: It schedules the
timeout as if by invoking the
| |
| select | back to summary |
|---|---|
| public int select() throws IOException Implements abstract java. Doc from java. Selects a set of keys whose corresponding channels are ready for I/O operations. This method performs a blocking selection
operation. It returns only after at least one channel is selected,
this selector's
| |
| selectedKeys | back to summary |
|---|---|
| public Set Implements abstract java. Doc from java. Returns this selector's selected-key set. Keys may be removed from, but not directly added to, the
selected-key set. Any attempt to add an object to the key set will
cause an The selected-key set is not thread-safe.
| |
| selectNow | back to summary |
|---|---|
| public int selectNow() throws IOException Implements abstract java. Doc from java. Selects a set of keys whose corresponding channels are ready for I/O operations. This method performs a non-blocking selection operation. If no channels have become selectable since the previous selection operation then this method immediately returns zero. Invoking this method clears the effect of any previous invocations
of the
| |
| wakeup | back to summary |
|---|---|
| public Selector wakeup() Implements abstract java. Doc from java. Causes the first selection operation that has not yet returned to return immediately. If another thread is currently blocked in a selection operation then
that invocation will return immediately. If no selection operation is
currently in progress then the next invocation of a selection operation
will return immediately unless Invoking this method more than once between two successive selection operations has the same effect as invoking it just once. | |
| wakeupReceived | back to summary |
|---|---|
| private void wakeupReceived() throws IOException | |