Adjusts this channel's blocking mode.
If this channel is registered with one or more selectors then an attempt to place it into blocking mode will cause an {@link IllegalBlockingModeException} to be thrown.
This method may be invoked at any time. The new blocking mode will only affect I/O operations that are initiated after this method returns. For some implementations this may require blocking until all pending I/O operations are complete.
If this method is invoked while another invocation of this method or of the {@link #register(Selector,int) register} method is in progressthen it will first block until the other operation is complete.
@param block If
true then this channel will be placed inblocking mode; if
false then it will be placed non-blocking mode
@return This selectable channel
@throws ClosedChannelException If this channel is closed
@throws IllegalBlockingModeException If
block is
true and this channel is registered with one or more selectors
@throws IOException If an I/O error occurs