Web::Transport::PlatformResolver
Resolve domain names using platform's resolver
SYNOPSIS
use Web::Transport::PlatformResolver;
$resolver = Web::Transport::PlatformResolver->new;
$resolver->resolve (Web::Host->parse_string ("example.com"))->then (sub {
warn defined $_[0] && $_[0]->stringify;
});
DESCRIPTION
The Web::Transport::PlatformResolver
module defines a name resolver which resolves names using the system's resolution API.
This module is a resolver (see "RESOLVERS" in Web::Transport).
METHOD
Following methods are available:
$resolver = Web::Transport::PlatformResolver->new
-
Create a resolver.
$promise = $resolver->resolve ($host, $name => $value, ...)
-
Resolve a domain.
The first argument must be a host (Web::Host) to resolve.
Additionally, following named arguments can be specified:
- no_cache => $boolean
-
Ignored for this resolver (for now, at least). That is, the platform's DNS cache can't be disabled.
- signal => $signal
-
The abort signal (AbortSignal) for the resolution. If the abort controller (AbortController) associated with the signal is aborted, the resolution is aborted and the method's promise is rejected with an object whose
name
isAbortError
whenever possible. - debug => $debug
-
The debug mode. The default value is 0 (not in the debug mode). See
WEBUA_DEBUG
section in Web::Transport for available mode values.
The method returns a promise (Promise), which is to be resolved with the result. If the host is a domain and is successfully resolved into an IP address, or the host is an IP address, the promise is resolved with a host (Web::Host) representing that IP address. Otherwise, it is resolved with
undef
.
SEE ALSO
SPECIFICATION
Web Transport Processing <https://wiki.suikawiki.org/n/Web%20Transport%20Processing>
.
AUTHOR
Wakaba <wakaba@suikawiki.org>.
LICENSE
Copyright 2016-2018 Wakaba <wakaba@suikawiki.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.