Code example for SelectionKey

Methods: interestOps

0
		SocketChannel channel = (SocketChannel) key.channel();
		return channel.isOpen();
	} 
 
	public void resume() { 
		key.interestOps(SelectionKey.OP_WRITE);
 
	} 
 
	public void pause() { 
		key.interestOps(SelectionKey.OP_READ);
	} 
 
	public void stop() { 
		ChannelProcessor channelProcessor = (ChannelProcessor) key.attachment();
		channelProcessor.close(key);
	} 
 
	public void clear() { 
		ChannelProcessor channelProcessor = (ChannelProcessor) key.attachment();
		if (channelProcessor instanceof ClearableChannelProcessor) {