code: public static Set<InetAddress> resolveLocalAddresses() {
          Set<InetAddress> addrs = new HashSet<InetAddress>();
          Enumeration<NetworkInterface> ns = null;
          try {
              ns = NetworkInterface.getNetworkInterfaces();
          } catch (SocketException e) {
              // ignored...
          }
          while (ns != null && ns.hasMoreElements()) {
              NetworkInterface n = ns.nextElement();
              Enumeration<InetAddress> is = n.getInetAddresses();
              while (is.hasMoreElements()) {
                  InetAddress i = is.nextElement();
                  if (!i.isLoopbackAddress() && !i.isLinkLocalAddress() && !i.isMulticastAddress()
                          && !isSpecialIp(i.getHostAddress())) addrs.add(i);
              }
          }
          return addrs;
      }
docs: 获取本地ip地址，有可能会有多个地址, 若有多个网卡则会搜集多个网卡的ip地址