protected void cancelAndNotify(SelectionKey key, ConnectedListener listener) {
		// cancel key
		this.cancel(key);

		// notify
		try {
			if (key != null && listener != null) {
				listener.notifyCancel((SocketChannel) key.channel());
			}
		} catch (Exception e) {
			NIO.LOGGER.error("fail to notify cancel for key:" + key, e);
		}
	}