1#ifndef NEFORCE_NETWORK_DNS_MESSAGE_HPP
2#define NEFORCE_NETWORK_DNS_MESSAGE_HPP
23NEFORCE_BEGIN_NAMESPACE__
123 network_exception(
what.
data(), static_type, static_cast<int>(
code)) {}
150 static constexpr auto static_type =
"dns_exception";
260NEFORCE_END_NAMESPACE__
static dns_exception network_error(const string &detail, const code code=code::NETWORK_ERROR)
创建网络错误异常
dns_exception(const string &what)
构造函数
static dns_exception parse_error(const string &detail)
创建解析错误异常
dns_exception(const string &what, const code code)
构造函数
static dns_exception timeout()
创建超时异常
unsigned char uint8_t
8位无符号整数类型
unsigned int uint32_t
32位无符号整数类型
unsigned short uint16_t
16位无符号整数类型
@ NOT_IMPLEMENTED
未实现,服务器不支持该查询类型
@ FORMAT_ERROR
格式错误,服务器无法解析查询
@ SERVER_FAILURE
服务器失败,无法处理查询
duration< int64_t, milli > milliseconds
毫秒持续时间
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result) noexcept(noexcept(inner::__move_aux(first, last, result)))
移动范围元素
NEFORCE_NODISCARD NEFORCE_ALWAYS_INLINE constexpr decltype(auto) data(Container &cont) noexcept(noexcept(cont.data()))
获取容器的底层数据指针
milliseconds query_time
查询耗时
vector< dns_record > authorities
权威记录
bool recursive_available
递归查询是否可用
vector< dns_record > additional
附加记录
dns_response response_code
响应码
vector< dns_record > answers
答案记录
NEFORCE_NODISCARD bool is_success() const noexcept
检查查询是否成功
dns_record(string n, const raw t, const dns_query c, const uint32_t ttl_val, string d) noexcept
构造函数
dns_record()=default
默认构造函数
NEFORCE_NODISCARD const char * what() const noexcept
获取错误信息
static constexpr auto static_type
静态类型字符串