Registers this channel with the given selector, returning a selection
key.
An invocation of this convenience method of the form
sc.register(sel, ops)
behaves in exactly the same way as the invocation
sc.register
(sel, ops, null)
Returns:
A key representing the registration of this channel with
the given selector
Parameters:
-
sel - The selector with which this channel is to be registered
-
ops - The interest set for the resulting key
Throws:
-
ClosedChannelException - If this channel is closed
-
IllegalBlockingModeException - If this channel is in blocking mode
-
IllegalSelectorException - If this channel was not created by the same provider
as the given selector
-
CancelledKeyException - If this channel is currently registered with the given selector
but the corresponding key has already been cancelled
-
IllegalArgumentException - If a bit in
ops does not correspond to an operation
that is supported by this channel, that is, if
set &
~validOps() != 0