code: public List<String> getAvailableNetworkInterfaces(boolean requiresMulticast) throws SocketException {
  
      Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
  
      List<String> multicastNIs = new ArrayList<String>();
  
      // Console.info("Available Multicast-enabled Network Interfaces");
      while (nis.hasMoreElements()) {
        NetworkInterface ni = nis.nextElement();
        if (ni.isUp() && !ni.isLoopback()) {
          if (requiresMulticast) {
            if (ni.supportsMulticast())
              multicastNIs.add(ni.getName());
          } else {
            multicastNIs.add(ni.getName());
          }
        }
      }
  
      return multicastNIs;
  
    }
docs: This gets a list of all the available network interface names.
  
  @param requiresMulticast return only NIs that are multicast capable
  
  @return the list of the currently available network interface names
  @throws SocketException if the
  {@linkplain NetworkInterface#getNetworkInterfaces()} call fails