Java.Nio.Channels.SelectableChannel.Register Method
Registers this channel with the specified selector for the specified interest set and an object to attach.

Syntax

[Android.Runtime.Register("register", "(Ljava/nio/channels/Selector;ILjava/lang/Object;)Ljava/nio/channels/SelectionKey;", "GetRegister_Ljava_nio_channels_Selector_ILjava_lang_Object_Handler")]
public abstract SelectionKey Register (Selector sel, [Android.Runtime.GeneratedEnum] Operations ops, Java.Lang.Object att)

Parameters

sel
the selector with which to register this channel.
ops
this channel's Java.Nio.Channels.SelectionKey.
att
the object to attach, can be null.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Nio.Channels.ClosedChannelExceptionif this channel is closed.
Java.Lang.IllegalArgumentExceptionif ops is not supported by this channel.
Java.Nio.Channels.IllegalBlockingModeExceptionif this 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.

Remarks

Registers this channel with the specified selector for the specified interest set and an object to attach. If the channel is already registered with the selector, the corresponding selection key is returned but its Java.Nio.Channels.SelectionKey is updated to ops and the attached object is updated to att. 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.

[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