An Address instance representing specified address.
SocketException on failure.
writeln("Enter IP address:"); string ip = readln().chomp(); try { Address address = parseAddress(ip); writefln("Looking up reverse of %s:", address.toAddrString()); try { string reverse = address.toHostNameString(); if (reverse) writefln(" Reverse name: %s", reverse); else writeln(" Reverse hostname not found."); } catch (SocketException e) writefln(" Lookup error: %s", e.msg); } catch (SocketException e) { writefln(" %s is not a valid IP address: %s", ip, e.msg); }
Provides _protocol-independent parsing of network addresses. Does not attempt name resolution. Uses getAddressInfo with AddressInfoFlags.NUMERICHOST if the current system supports it, and InternetAddress otherwise.