code: @Override
  	protected void receive() {
  		while (!Thread.currentThread().isInterrupted()) {
  			try {
  
  				// Waiting for packet...
  				byte[] buffer = new byte[512];
  				DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
  				if (multicastReceiver == null) {
  					return;
  				}
  				multicastReceiver.receive(packet);
  				processReceivedMessage(packet, buffer);
  
  			} catch (Exception cause) {
  				String msg = cause == null ? null : cause.getMessage();
  				if (msg != null && msg.contains("closed")) {
  					return;
  				}
  				logger.warn("Unexpected error occurred in UDP broadcaster!", cause);
  				try {
  					Thread.sleep(1000);
  				} catch (Exception interrupt) {
  					return;
  				}
  			}
  		}
  	}
docs: --- UDP MULTICAST RECEIVER ---