Address instance per socket address.getAddress
fn
Address[] getAddress(scope const(char)[] hostname, scope const(char)[] service = null)Provides _protocol-independent translation from host names to socket addresses. Uses getAddressInfo if the current system supports it, and InternetHost otherwise.
Returns
Array with one
Throws
SocketOSException on failure.
Example:
writeln("Resolving www.digitalmars.com:");
try
{
auto addresses = getAddress("www.digitalmars.com");
foreach (address; addresses)
writefln(" IP: %s", address.toAddrString());
}
catch (SocketException e)
writefln(" Lookup failed: %s", e.msg);fn
Address[] getAddress(scope const(char)[] hostname, ushort port)ditto