Function wasi::sockets::ip_name_lookup::resolve_addresses

source ·
pub fn resolve_addresses(
    network: &Network,
    name: &str
) -> Result<ResolveAddressStream, ErrorCode>
Expand description

Resolve an internet host name to a list of IP addresses.

Unicode domain names are automatically converted to ASCII using IDNA encoding. If the input is an IP address string, the address is parsed and returned as-is without making any external requests.

See the wasi-socket proposal README.md for a comparison with getaddrinfo.

This function never blocks. It either immediately fails or immediately returns successfully with a resolve-address-stream that can be used to (asynchronously) fetch the results.

§Typical errors

  • invalid-argument: name is a syntactically invalid domain name or IP address.

§References: