private void broadcast (int udpPort, DatagramSocket socket) throws IOException {
		int classID = kryo.getRegisteredClass(DiscoverHost.class).getID();
		ByteBuffer dataBuffer = ByteBuffer.allocate(4);
		IntSerializer.put(dataBuffer, classID, true);
		dataBuffer.flip();
		byte[] data = new byte[dataBuffer.limit()];
		dataBuffer.get(data);
		for (NetworkInterface iface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
			for (InetAddress address : Collections.list(iface.getInetAddresses())) {
				if (!address.isSiteLocalAddress()) continue;
				// Java 1.5 doesn't support getting the subnet mask, so try the two most common.
				byte[] ip = address.getAddress();
				ip[3] = -1; // 255.255.255.0
				socket.send(new DatagramPacket(data, data.length, InetAddress.getByAddress(ip), udpPort));
				ip[2] = -1; // 255.255.0.0
				socket.send(new DatagramPacket(data, data.length, InetAddress.getByAddress(ip), udpPort));
			}
		}
		if (DEBUG) debug("kryonet", "Broadcasted host discovery on port: " + udpPort);
	}