code: protected void close(SelectionKey key, Exception cause) {
  		if (key == null) {
  			return;
  		}
  
  		// Cancel key
  		key.cancel();
  
  		// Get channel
  		SelectableChannel channel = key.channel();
  		if (channel == null) {
  			return;
  		}
  
  		// Debug
  		if (debug) {
  			try {
  				if (channel instanceof SocketChannel) {
  					SocketChannel socketChannel = (SocketChannel) channel;
  					logger.info("Client channel closed to " + socketChannel.getRemoteAddress() + ".", cause);
  				}
  			} catch (Exception ignored) {
  			}
  		}
  
  		// Close channel
  		try {
  			channel.close();
  		} catch (Exception ignored) {
  		}
  	}
docs: --- CLOSE CHANNEL ---