public class InetAddresses extends Object
| 构造器和说明 |
|---|
InetAddresses() |
| 限定符和类型 | 方法和说明 |
|---|---|
static InetAddress |
getLocalAddress()
返回第一个可用的本机local IP
|
static List<InetAddress> |
getLocalAddresses()
返回本机所有local IP
|
static String |
getLocalIp()
返回第一个可用的本机local IP
|
static List<String> |
getLocalIps()
返回本机所有local IP
|
public static String getLocalIp() throws SocketException
SocketExceptionpublic static InetAddress getLocalAddress() throws SocketException
SocketExceptionpublic static List<String> getLocalIps() throws SocketException
SocketExceptionpublic static List<InetAddress> getLocalAddresses() throws SocketException
SocketExceptionCopyright © 2016. All rights reserved.