don't throw UnknownHostException from InetAddress.getByName("0.0.0.0")

0.0.0.0 means any local interface, which is commonly used by servers
which wish to listen on all interfaces.
This commit is contained in:
Joel Dice
2013-12-18 10:12:10 -07:00
parent dae1f81d27
commit 5f40c1642e
3 changed files with 23 additions and 4 deletions

View File

@ -19,9 +19,6 @@ public class InetAddress {
private InetAddress(String name) throws UnknownHostException {
this.name = name;
this.ip = ipv4AddressForName(name);
if (ip == 0) {
throw new UnknownHostException(name);
}
}
public String getHostName() {