public abstract int selectNow () throws IOException

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 method.

Returns:  The number of keys, possibly zero, whose ready-operation sets were updated by the selection operation

Exceptions:
IOException     If an I/O error occurs
ClosedSelectorException     If this selector is closed