class Durian::Resolver
- Durian::Resolver
- Reference
- Object
Defined in:
durian/resolver.crdurian/resolver/cache.cr
durian/resolver/cache/ip_address.cr
durian/resolver/network.cr
durian/resolver/network/tcp_client.cr
durian/resolver/network/udp_client.cr
Constant Summary
-
IPAddressRecordFlags =
[RecordFlag::A, RecordFlag::AAAA]
Constructors
- .new(dnsServers : Array(Tuple(Socket::IPAddress, Protocol)))
- .new(dnsServer : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP)
Class Method Summary
- .fetch_ip_cache(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil)
- .get_tcp_socket!(host : String, port : Int32, resolver : Resolver, connect_timeout : Int | Float | Nil = nil) : ::TCPSocket
- .get_udp_socket!(host : String, port : Int32, resolver : Resolver) : UDPSocket
- .getaddrinfo!(host : String, port : Int32, resolver : Resolver) : Tuple(Fetch, Socket::IPAddress)
- .getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil = nil, dnsServer : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP, &block : Tuple(Fetch, Array(Socket::IPAddress)) -> )
- .getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil = nil, dnsServer : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP) : Tuple(Fetch, Array(Socket::IPAddress))
- .getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil, dnsServers : Array(Tuple(Socket::IPAddress, Protocol)), &block : Tuple(Fetch, Array(Socket::IPAddress)) -> )
- .getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil, dnsServers : Array(Tuple(Socket::IPAddress, Protocol))) : Tuple(Fetch, Array(Socket::IPAddress))
- .getaddrinfo_all(host : String, port : Int32, resolver : Resolver, &block : Tuple(Fetch, Array(Socket::IPAddress)) -> )
- .getaddrinfo_all(host : String, port : Int32, resolver : Resolver) : Tuple(Fetch, Array(Socket::IPAddress))
Instance Method Summary
- #cache : Durian::Resolver::Cache?
- #cache=(value : Cache)
- #cache_expires?(host, flags : Array(RecordFlag))
- #dnsServers : Array(Tuple(Socket::IPAddress, Protocol))
- #dnsServers=(dnsServers : Array(Tuple(Socket::IPAddress, Protocol)))
- #fetch_cache(host, flags : Array(RecordFlag), resolve_response : ResolveResponse)
- #fetch_raw_cache(host, flag : RecordFlag)
- #get_socket_protocol(socket : NetworkClient)
- #ip_cache : Durian::Resolver::Cache::IPAddress?
- #ip_cache=(value : Cache::IPAddress)
- #mismatch_retry
- #option : Option
- #option=(option : Option)
- #random : Random
- #random=(random : Random)
- #resolve(host, flag : RecordFlag, strict_answer : Bool = false, &callback : ResolveResponse -> )
- #resolve(host, flags : Array(RecordFlag), strict_answer : Bool = false, &callback : ResolveResponse -> )
- #resolve_by_flag!(host : String, flag : RecordFlag, strict_answer : Bool = false) : Packet::Response | Nil
- #resolve_by_flag!(socket : NetworkClient, host : String, flag : RecordFlag, strict_answer : Bool = false) : Packet::Response | Nil
- #resolve_task(host : String, task : ResolveTask)
- #run
- #set_cache(host, packet : Packet::Response, flag : RecordFlag)
- #tasks : Hash(String, Hash(String, ResolveTask))
- #tasks=(tasks : Hash(String, Hash(String, ResolveTask)))
- #to_ip_address(host : String)
Constructor Detail
def self.new(dnsServer : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP)
#
Class Method Detail
def self.get_tcp_socket!(host : String, port : Int32, resolver : Resolver, connect_timeout : Int | Float | Nil = nil) : ::TCPSocket
#
def self.getaddrinfo!(host : String, port : Int32, resolver : Resolver) : Tuple(Fetch, Socket::IPAddress)
#
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil = nil, dnsServer : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP, &block : Tuple(Fetch, Array(Socket::IPAddress)) -> )
#
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil = nil, dnsServer : Socket::IPAddress = Socket::IPAddress.new("8.8.8.8", 53), protocol : Protocol = Protocol::UDP) : Tuple(Fetch, Array(Socket::IPAddress))
#
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil, dnsServers : Array(Tuple(Socket::IPAddress, Protocol)), &block : Tuple(Fetch, Array(Socket::IPAddress)) -> )
#
def self.getaddrinfo_all(host : String, port : Int32, ip_cache : Cache::IPAddress | Nil, dnsServers : Array(Tuple(Socket::IPAddress, Protocol))) : Tuple(Fetch, Array(Socket::IPAddress))
#
def self.getaddrinfo_all(host : String, port : Int32, resolver : Resolver, &block : Tuple(Fetch, Array(Socket::IPAddress)) -> )
#
def self.getaddrinfo_all(host : String, port : Int32, resolver : Resolver) : Tuple(Fetch, Array(Socket::IPAddress))
#
Instance Method Detail
def resolve(host, flag : RecordFlag, strict_answer : Bool = false, &callback : ResolveResponse -> )
#
def resolve(host, flags : Array(RecordFlag), strict_answer : Bool = false, &callback : ResolveResponse -> )
#
def resolve_by_flag!(host : String, flag : RecordFlag, strict_answer : Bool = false) : Packet::Response | Nil
#
def resolve_by_flag!(socket : NetworkClient, host : String, flag : RecordFlag, strict_answer : Bool = false) : Packet::Response | Nil
#