lookupAddress method
Resolves the IP addresses for the given hostname
, using cache if available.
hostname
: The hostname to resolve.- Returns a list of resolved InternetAddress objects.
Implementation
FutureOr<List<InternetAddress>> lookupAddress(String hostname) {
var cached = _addressesCache[hostname];
if (cached != null) return cached;
return lookupAddressImpl(hostname).then((address) {
return _addressesCache[hostname] ??= address;
});
}