public static InetAddress getBroadcastAddr () {
        
        NetworkInterface iFace;
        try {
            iFace = NetworkInterface.getByName(interfaceName);
            if (iFace.isLoopback() || (! iFace.isUp()) ) {
                return null;
            }
        } catch (SocketException e) {
            log.warning("Could not find the interface");
            return null;
        }
        
        for (InterfaceAddress addr : iFace.getInterfaceAddresses()) {
            if (addr == null) {
                continue;
            }
            InetAddress broadcast = addr.getBroadcast();
            if (broadcast == null) {
                continue;
            } else {
                return broadcast;
            }
        }
        return null;
        
    }