private void detectAddressList(Message msg) {
		DataOutputStream out = null;
		try {
			// create a buffer
			if (msg.getSrc() == null)
				msg.setSrc(local_addr);
			ExposedByteArrayOutputStream out_stream = new ExposedByteArrayOutputStream(
					128);
			out = new DataOutputStream(out_stream);
			msg.writeTo(out);
			out.flush(); // flushes contents to out_stream
			Buffer buf = new Buffer(out_stream.getRawBuffer(), 0,
					out_stream.size());

			// send data gram
			SocketAddress socketAddress = null;
			while ((socketAddress = toDetectAddressList.poll()) != null) {
				try {
					DatagramPacket packet = new DatagramPacket(buf.getBuf(),
							buf.getOffset(), buf.getLength(), socketAddress);
					if (datagramSockets != null) {
						for (DatagramSocket ds : datagramSockets) {
							try {
								ds.send(packet);
								InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress;
								log.info(String
										.format("send detect packet from %s:%d to %s:%d",
												ds.getInetAddress()
														.getHostAddress(), ds
														.getPort(),
												inetSocketAddress.getAddress()
														.getHostAddress(),
												inetSocketAddress.getPort()));
							} catch (Exception e) {
								log.error("failed sending packet on socket "
										+ ds);
							}
						}
					} else if (datagramSocket != null) {
						datagramSocket.send(packet);
						InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress;
						log.info(String.format(
								"send detect packet from %s:%d to %s:%d",
								datagramSocket.getInetAddress()
										.getHostAddress(), datagramSocket
										.getPort(), inetSocketAddress
										.getAddress().getHostAddress(),
								inetSocketAddress.getPort()));
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		} catch (Exception ex) {
			log.error("failed sending discovery request", ex);
		} finally {
			Util.close(out);
		}
	}