public UdpListenThread() {
		m_udpAllowHelper = new GetMeAllowedHelper();

		try {
			Configuration conf = Configuration.instance();

			this.m_multicastIsa = new InetSocketAddress(
					conf.getMulticastHost(), conf.getMulticastPort());

			// these constructors should already call setReuseAddr
			try {
				this.m_broadcastSocket = new DatagramSocket(null);
				m_broadcastSocket.setReuseAddress(true);
				m_broadcastSocket.setBroadcast(true);
				m_broadcastSocket.bind(new InetSocketAddress(4337));
			} catch (BindException be) {
				this.m_broadcastSocket = null;
				D.out("Error binding broadcast/unicast socket ("
						+ be.getMessage() + ")");
				// Catch all errors (tomcat 2007-12-22)
			} catch (Throwable e) {
				e.printStackTrace();
				m_broadcastSocket = null;
			}

			try {
				this.m_allDevicesMulticastSocket = new MulticastSocket(conf
						.getMulticastPort());
				// System.out.println (this.allSocket.getReuseAddress());
				this.m_allDevicesMulticastSocket.setLoopbackMode(false);
				this.m_allDevicesMulticastSocket.setTimeToLive(100); // hm?
				this.m_allDevicesMulticastSocket.setReuseAddress(true);
				this.m_allDevicesMulticastSocket.setBroadcast(false);
				this.m_allDevicesMulticastSocket.joinGroup(this.m_multicastIsa
						.getAddress());
			} catch (BindException be) {
				this.m_allDevicesMulticastSocket = null;
				D.out("Error binding m_allDevicesMulticastSocket socket ("
						+ be.getMessage() + ")");
				// Catch all errors (tomcat 2007-12-22)
			} catch (Throwable e) {
				e.printStackTrace();
				m_allDevicesMulticastSocket = null;
			}

			try {
				m_singleDeviceMulticastSocket = new MulticastSocket(conf
						.getMulticastPort());

				Enumeration<NetworkInterface> nifaces = NetworkInterface
						.getNetworkInterfaces();
				while (nifaces.hasMoreElements()) {
					NetworkInterface iface = nifaces.nextElement();
					try {
						m_singleDeviceMulticastSocket
								.setNetworkInterface(iface);
						m_singleDeviceMulticastSocket.setLoopbackMode(false);
						m_singleDeviceMulticastSocket.setTimeToLive(100); // hm?
						m_singleDeviceMulticastSocket.setReuseAddress(true);
						m_singleDeviceMulticastSocket.setBroadcast(false);
						m_singleDeviceMulticastSocket.joinGroup(m_multicastIsa
								.getAddress());
					} catch (Throwable t) {
						D.out (iface.getDisplayName() + ": " + t.getMessage());
					}
				}

			} catch (BindException be) {
				m_singleDeviceMulticastSocket = null;
				D.out("Error binding m_singleDeviceMulticastSocket socket ("
						+ be.getMessage() + ")");
			} catch (Throwable e) {
				e.printStackTrace();
				m_singleDeviceMulticastSocket = null;
			}

		} catch (Throwable e) {

			e.printStackTrace();
			System.exit(1);
		}
	}