Update AddressUtils.java

This commit is contained in:
XiaoFu
2018-12-12 10:03:49 +08:00
committed by GitHub
parent 35e0e882c1
commit ba5865683f

View File

@@ -54,15 +54,6 @@ public class AddressUtils {
public static InetAddress getHostAddress() {
InetAddress localAddress = null;
try {
localAddress = InetAddress.getLocalHost();
if (isValidHostAddress(localAddress)) {
return localAddress;
}
} catch (Throwable e) {
logger.warn("Failed to retriving local host ip address, try scan network card ip address. cause: "
+ e.getMessage());
}
try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
if (interfaces != null) {