class Durian::Resolver
- Durian::Resolver
- Reference
- Object
Defined in:
durian/resolver.crConstant 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::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::Cache::IPAddress?
- #ip_cache=(value : Cache::IPAddress)
- #mapping?(host : String, port : Int32 | Nil = 0) : Option::Mapping | Nil
- #mapping_local?(item, port : Int32 = 0) : Array(Socket::IPAddress) | Nil
- #mapping_to?(item, port : Int32 = 0) : Tuple(String, Int32) | Nil
- #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!(specify : Array(Tuple(Socket::IPAddress, Protocol)) | Nil, 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(specify : Array(Tuple(Socket::IPAddress, Protocol)) | Nil, host : String, task : ResolveTask)
- #run
- #set_cache(host, packet : Packet::Response, flag : RecordFlag)
- #specify?(host : String, port : Int32 | Nil = 0) : Option::Specify | Nil
- #tasks : Immutable::Map(String, Immutable::Map(String, ResolveTask))
- #tasks=(tasks : Immutable::Map(String, Immutable::Map(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!(specify : Array(Tuple(Socket::IPAddress, Protocol)) | Nil, 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
#
def resolve_task(specify : Array(Tuple(Socket::IPAddress, Protocol)) | Nil, host : String, task : ResolveTask)
#