struct

Socket::Addrinfo

Inherits Crystal::System::Addrinfo / Struct / Value / Object

Domain name resolver.

Query Concurrency Behaviour

On most platforms, DNS queries are currently resolved synchronously. Calling a resolve method blocks the entire thread until it returns. This can cause latencies, especially in single-threaded processes.

DNS queries resolve asynchronously on the following platforms:

  • Windows 8 and higher

NOTE: Follow the discussion in Async DNS resolution (#13619) for more details.

Class methods

build_addrinfo(ip_address : IPAddress, family, type, protocol, &block : Addrinfo -> )
Source
build_tcp(ip_address : IPAddress, family = Family::UNSPEC, &)
Source
build_udp(ip_address : IPAddress, family = Family::UNSPEC, &)
Source