All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.clustermate.service.ServerUtil Maven / Gradle / Ivy

There is a newer version: 0.10.5
Show newest version
package com.fasterxml.clustermate.service;

import java.io.IOException;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Collection;
import java.util.Enumeration;

public class ServerUtil
{
    public static void findLocalIPs(Collection ips) throws IOException
    {
        Enumeration en = NetworkInterface.getNetworkInterfaces();
        while (en.hasMoreElements()) {
            NetworkInterface networkInt = en.nextElement();
            Enumeration en2 = networkInt.getInetAddresses();
            while (en2.hasMoreElements()) {
                ips.add(en2.nextElement());
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy