module

XMPP::DnsSrv

Minimal DNS SRV (RFC 2782) resolver used by XEP-0368 connection discovery. Crystal's stdlib resolves only A/AAAA records via Socket::Addrinfo, so this hand-rolled resolver issues a UDP SRV query through the system resolver configured in /etc/resolv.conf.

Class methods

resolve(service : String, domain : String, timeout : Float64 = 2.0) : Array(SRVRecord)

Resolves SRV records for the given service and domain.

service is the underscore-prefixed service name, e.g. "_xmpps-client". domain is the XMPP service domain, e.g. "example.org".

Returns the records sorted by RFC 2782 priority, with weighted randomization applied within equal priorities. Returns an empty array when no records exist, the query fails, or no resolver is configured.

Source
stub_nameservers(servers : Array(String), &)
Source

Nested types