String localIp = null;
try {
InetAddress ia = InetAddress.getLocalHost();
localIp = ia.getHostAddress();
} catch (UnknownHostException e) {
logger.error("get local host error, caused by {}", e);
}
网友评论