Loading...
Searching...
No Matches
Dns.hpp
Go to the documentation of this file.
7// In no event will the authors be held liable for any damages arising from the use of this software.
172[[nodiscard]] SFML_NETWORK_API std::optional<IpAddress> getPublicAddress(std::optional<Time> timeout = std::nullopt,
Utility string class that automatically handles conversions between types and encodings.
Definition String.hpp:91
constexpr Time seconds(float amount)
Construct a time value from a number of seconds.
Perform Domain Name System queries to lookup DNS records for various purposes.
Definition Dns.hpp:49
std::optional< std::vector< IpAddress > > resolve(const sf::String &hostname, const std::vector< sf::IpAddress > &servers={}, std::optional< sf::Time > timeout=sf::seconds(1))
Resolve a hostname into a list of IP addresses.
std::optional< IpAddress > getPublicAddress(std::optional< Time > timeout=std::nullopt, IpAddress::Type type=IpAddress::Type::IpV4)
Get the computer's public address via DNS.
std::vector< std::vector< sf::String > > queryTxt(const sf::String &hostname, const std::vector< sf::IpAddress > &servers={}, std::optional< sf::Time > timeout=sf::seconds(1))
Query TXT records for a hostname.
std::vector< sf::String > queryNs(const sf::String &hostname, const std::vector< sf::IpAddress > &servers={}, std::optional< sf::Time > timeout=sf::seconds(1))
Query NS records for a hostname.
std::vector< SrvRecord > querySrv(const sf::String &hostname, const std::vector< sf::IpAddress > &servers={}, std::optional< sf::Time > timeout=sf::seconds(1))
Query SRV records for a hostname.
std::vector< MxRecord > queryMx(const sf::String &hostname, const std::vector< sf::IpAddress > &servers={}, std::optional< sf::Time > timeout=sf::seconds(1))
Query MX records for a hostname.
std::uint16_t preference
Preference of this record among others, lower values are preferred.
Definition Dns.hpp:86
std::uint16_t weight
Server selection mechanism, larger weights should be given a proportionately higher probability of be...
Definition Dns.hpp:111
std::uint16_t priority
The priority of the target host, a client must attempt to contact the target host with the lowest-num...
Definition Dns.hpp:112