Java.Nio.Channels.SelectableChannel.Register Method
Registers this channel with the specified selector for the specified interest set.

Syntax

[Android.Runtime.Register("register", "(Ljava/nio/channels/Selector;I)Ljava/nio/channels/SelectionKey;", "")]
public SelectionKey Register (Selector selector, [Android.Runtime.GeneratedEnum] Operations operations)

Parameters

selector
the selector with which to register this channel.
operations
this channel's Java.Nio.Channels.SelectionKey.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Nio.Channels.ClosedChannelExceptionif the channel is closed.
Java.Nio.Channels.IllegalBlockingModeExceptionif the channel is in blocking mode.
Java.Nio.Channels.IllegalSelectorExceptionif this channel does not have the same provider as the given selector.
Java.Nio.Channels.CancelledKeyExceptionif this channel is registered but its key has been canceled.
Java.Lang.IllegalArgumentExceptionif the operation given is not supported by this channel.

Remarks

Registers this channel with the specified selector for the specified interest set. If the channel is already registered with the selector, the corresponding selection key is returned but the Java.Nio.Channels.SelectionKey is updated to operations. The returned key is canceled if the channel is closed while registering is in progress.

Calling this method is valid at any time. If another thread executes this method or the configureBlocking(boolean method then this call is blocked until the other call finishes. After that, it will synchronize on the key set of the selector and thus may again block if other threads also hold locks on the key set of the same selector.

Calling this method is equivalent to calling register(selector, operations, null).

[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