for(String addr: addrs) { try { retval=convertBindAddress(addr); if(retval != null) break; retval=convertBindAddress(propertyValue); if(scope == 0) { Inet6Address ret=getScopedInetAddress(addr); if(ret != null) retval=ret;
protected static InetAddress convertBindAddress(String value) throws Exception { InetAddress retval=null; Util.AddressScope addr_scope=null; try { addr_scope=Util.AddressScope.valueOf(value.toUpperCase()); } catch(Throwable ignored) { } if(addr_scope != null) retval=Util.getAddress(addr_scope); else { if(value.startsWith("match")) retval=Util.getAddressByPatternMatch(value); else if(value.startsWith("custom:")) retval=getAddressByCustomCode(value.substring("custom:".length())); else retval=InetAddress.getByName(value); } if(retval instanceof Inet4Address && retval.isMulticastAddress() && Util.getIpStackType() == StackType.IPv6) { String tmp=prefix + value; retval=InetAddress.getByName(tmp); return retval; } return retval; }
for(String addr: addrs) { try { retval=convertBindAddress(addr); if(retval != null) break; retval=convertBindAddress(propertyValue); if(scope == 0) { Inet6Address ret=getScopedInetAddress(addr); if(ret != null) retval=ret;
protected static InetAddress convertBindAddress(String value) throws Exception { InetAddress retval=null; Util.AddressScope addr_scope=null; try { addr_scope=Util.AddressScope.valueOf(value.toUpperCase()); } catch(Throwable ex) { } if(addr_scope != null) retval=Util.getAddress(addr_scope); else { if(value.startsWith("match")) retval=Util.getAddressByPatternMatch(value); else if(value.startsWith("custom:")) retval=getAddressByCustomCode(value.substring("custom:".length())); else retval=InetAddress.getByName(value); } if(retval instanceof Inet4Address && retval.isMulticastAddress() && Util.getIpStackType() == StackType.IPv6) { String tmp=prefix + value; retval=InetAddress.getByName(tmp); return retval; } return retval; }