docs: protected void connect(InetSocketAddress localEP, InetSocketAddress serverCtrlEP,
  		CRI cri, boolean useNAT) throws KNXException
  	{
  		ctrlEP = serverCtrlEP;
  		isNatAware = useNAT;
  		logger = LogManager.getManager().getLogService(getName());
  		try {
  			// if we allow localEP to be null, we would create an unbound socket
  			if (localEP == null)
  				throw new KNXIllegalArgumentException("no local endpoint specified");
  			logger.info("establish link from " + localEP + " to " + ctrlEP);
  			socket = new DatagramSocket(localEP);
  			// HPAI throws if wildcard local address (0.0.0.0) is supplied
  			final HPAI hpai =
  				new HPAI(HPAI.IPV4_UDP, isNatAware ? null : (InetSocketAddress) socket
  					.getLocalSocketAddress());
  			final byte[] buf = PacketHelper.toPacket(new ConnectRequest(cri, hpai, hpai));
  			final DatagramPacket p =
  				new DatagramPacket(buf, buf.length, ctrlEP.getAddress(), ctrlEP.getPort());
  			socket.send(p);
  		}
  		catch (final IOException e) {
  			if (socket != null)
  				socket.close();
  			logger.error("communication failure on connect", e);
  			if (localEP.getAddress().isLoopbackAddress())
  				logger.warn("try to specify the actual IP address of the local host");
  			LogManager.getManager().removeLogService(getName());
  			throw new KNXException(e.getMessage());
  		}
  		logger.info("wait for connect response from " + ctrlEP + " ...");
  		startReceiver();
  		final boolean changed = waitForStateChange(CLOSED, CONNECT_REQ_TIMEOUT);
  		if (state == OK) {
  			(heartbeat = new HeartbeatMonitor()).start();
  			logger.info("link established");
  			return;
  		}
  		// quit, cleanup and notify client
  		receiver.quit();
  		socket.close();
  		KNXException e;
  		if (!changed)
  			e = new KNXTimeoutException("timeout connecting to control endpoint "
  					+ ctrlEP);
  		else if (state == ACK_ERROR)
  			e = new KNXRemoteException(
  				"acknowledge error, failed to connect to control endpoint " + ctrlEP);
  		else
  			e = new KNXInvalidResponseException("invalid connect response from " + ctrlEP);
  		setState(CLOSED);
  		logger.error("establishing connection failed", e);
  		LogManager.getManager().removeLogService(getName());
  		throw e;
  	}