Here you can find the source of getLocalInterfaces()
Parameter | Description |
---|---|
SocketException | if an error occurs getting the interface list. |
public static Enumeration<NetworkInterface> getLocalInterfaces() throws SocketException
//package com.java2s; /*/*from ww w. j av a 2s.c o m*/ * (C) Copyright IBM Corp. 2011 * * LICENSE: Eclipse Public License v1.0 * http://www.eclipse.org/legal/epl-v10.html */ import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; public class Main { /** * Return the set of network interfaces for the local host. * * @return an enumeration of the interfaces or null otherwise. * @throws SocketException if an error occurs getting the interface list. */ public static Enumeration<NetworkInterface> getLocalInterfaces() throws SocketException { return NetworkInterface.getNetworkInterfaces(); } }