コード例 #1
0
 public String getLocalAddress() {
   InetAddress mcastAddr = ssdpMultiGroup.getAddress();
   Enumeration addrs = ssdpMultiIf.getInetAddresses();
   while (addrs.hasMoreElements()) {
     InetAddress addr = (InetAddress) addrs.nextElement();
     if (mcastAddr instanceof Inet6Address && addr instanceof Inet6Address)
       return addr.getHostAddress();
     if (mcastAddr instanceof Inet4Address && addr instanceof Inet4Address)
       return addr.getHostAddress();
   }
   return "";
 }
コード例 #2
0
 public InetAddress getMulticastInetAddress() {
   return ssdpMultiGroup.getAddress();
 }