public interface NioTask<C extends java.nio.channels.SelectableChannel>
NioEventLoop when a SelectableChannel becomes ready.| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelReady(C ch,
java.nio.channels.SelectionKey key)
Invoked when the
SelectableChannel has been selected by the Selector. |
void |
channelUnregistered(C ch,
java.lang.Throwable cause)
Invoked when the
SelectionKey of the specified SelectableChannel has been cancelled and thus
this NioTask will not be notified anymore. |
void channelReady(C ch, java.nio.channels.SelectionKey key) throws java.lang.Exception
SelectableChannel has been selected by the Selector.java.lang.Exceptionvoid channelUnregistered(C ch, java.lang.Throwable cause) throws java.lang.Exception
SelectionKey of the specified SelectableChannel has been cancelled and thus
this NioTask will not be notified anymore.cause - the cause of the unregistration. null if a user called SelectionKey.cancel() or
the event loop has been shut down.java.lang.Exception