Represents a FileDescriptor that you can select. This means that you can register listeners for this file descriptor on a given Selector object that will be called whenever there is data available to be read or written without blocking the reading/writing thread.

By: Stéphane Épardaud

no type hierarchy

Attributes
blockingSource Codeshared formal variable Boolean blocking

The blocking mode.

Inherited Attributes
Attributes inherited from: Object
Methods
readAsyncSource Codeshared void readAsync(Selector selector, void consume(ByteBuffer buffer), ByteBuffer buffer = ...)

Register a reading listener to the given selector. The reading listener will be invoked by the Selector whenever data can be read from this file descriptor without blocking.

If you are no longer interested in read events from the selector, you should return false from your listener when invoked.

Parameters:
  • buffer = newBuffer()
See also Selector
writeAsyncSource Codeshared void writeAsync(Selector selector, void producer(ByteBuffer buffer), ByteBuffer buffer = ...)

Register a writing listener to the given selector. The writing listener will be invoked by the Selector whenever data can be written to this file descriptor without blocking.

If you are no longer interested in write events from the selector, you should return false from your listener when invoked.

Parameters:
  • buffer = newBuffer()
See also Selector
Inherited Methods
Methods inherited from: Object
Methods inherited from: Closeable
Methods inherited from: ReadableFileDescriptor
Methods inherited from: WritableFileDescriptor