- All Known Implementing Classes:
public interface IOHubReadyListenerInterface for receiving callbacks when a
SelectableChannelis ready on its registered
- See Also:
IOHub.register(SelectableChannel, IOHubReadyListener, boolean, boolean, boolean, boolean, IOHubRegistrationCallback),
void ready(boolean accept, boolean connect, boolean read, boolean write)Callback to indicate the
SelectableChannelthat this listener was registered for is ready for the indicated operations. The
SelectionKey.interestOps()will have been cleared for all the operations that are
trueso the callback can be assured that processing of any one specific operation will be linearized, though there may be concurrent calls to ready() with disjoint ready operations. The callback will most likely want to re-register for
IOHub.addInterestAccept(SelectionKey)immediately before returning from a ready notification of the read or accept status. The callback will only want to re-register for a
IOHub.addInterestWrite(SelectionKey)if it has filled the
SelectableChannel's output buffer and has more data to write.
accept- if the
SelectableChannelhas a connection to accept. Call
IOHub.addInterestAccept(SelectionKey)to request additional callbacks for this ready state.
connect- if the
SelectableChannelhas established a connection. Call
IOHub.addInterestConnect(SelectionKey)to request additional callbacks for this ready state.
read- if the
SelectableChannelhas data available to read. Call
IOHub.addInterestRead(SelectionKey)to request additional callbacks for this ready state.
write- if the
SelectableChannelcan accept data for writing. Call
IOHub.addInterestWrite(SelectionKey)to request additional callbacks for this ready state.