Android Guides | Samples

Java.Nio.Channels.Selector Class

A controller for the selection of SelectableChannel objects.

See Also: Selector

Syntax

[Android.Runtime.Register("java/nio/channels/Selector", DoNotGenerateAcw=true)]
public abstract class Selector : Object, ICloseable, IDisposable

Remarks

A controller for the selection of SelectableChannel objects. Selectable channels can be registered with a selector and get a SelectionKey that represents the registration. The keys are also added to the selector's key set. Selection keys can be canceled so that the corresponding channel is no longer registered with the selector.

By invoking the select method, the key set is checked and all keys that have been canceled since last select operation are moved to the set of canceled keys. During the select operation, the channels registered with this selector are checked to see whether they are ready for operation according to their SelectionKey.

[Android Documentation]

Requirements

Namespace: Java.Nio.Channels
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Nio.Channels.Selector are listed below.

See Also: Object

Protected Constructors

Constructs a new Selector.
A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
abstract
IsOpenBoolean. Indicates whether this selector is open.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

abstract
Close()
Closes this selector.
abstract
Keys() : ICollection<SelectionKey>
Gets the set of registered keys.
static
Open() : Selector
Returns a selector returned by SelectorProvider.Provider's SelectorProvider.OpenSelector method.
abstract
Provider() : SelectorProvider
Gets the provider of this selector.
abstract
Select() : Int32
Detects if any of the registered channels is ready for I/O operations according to its SelectionKey.
abstract
Select(Int64) : Int32
Detects if any of the registered channels is ready for I/O operations according to its SelectionKey.
abstract
SelectedKeys() : ICollection<SelectionKey>
Gets the selection keys whose channels are ready for operation.
abstract
SelectNow() : Int32
Detects if any of the registered channels is ready for I/O operations according to its SelectionKey.
abstract
Wakeup() : Selector
Forces blocked select operations to return immediately.