<< ", name=" << rpr.name << ")";
}
+/// Constructor
+ResolvProtoResponse::ResolvProtoResponse(): ret(R_NOTFOUND), ttl(0)
+{
+}
+
/// Constructor
ResolvProtoResponse::ResolvProtoResponse(int fd)
{
}
/// Constructor
-ResolvProtoResponse::ResolvProtoResponse(ret_t ret, uint32_t ttl):
- ret(ret), ttl(ttl)
+ResolvProtoResponse::ResolvProtoResponse(ret_t ret, uint32_t ttl,
+ const ipvec_t& ips):
+ ret(ret), ttl(ttl), ips(ips)
{}
/// Envía por socket
/// Impresión de response
std::ostream& operator<< (std::ostream& os, const ResolvProtoResponse& rpr)
{
- if (rpr.ips.empty())
- return os;
os << "ResolvProtoResponse(ret=" << unsigned(rpr.ret)
- << ", ttl=" << rpr.ttl << ", ";
+ << ", ttl=" << rpr.ttl;
+ if (rpr.ips.empty())
+ return os << ")";
+ os << ", ";
std::copy(rpr.ips.begin(), rpr.ips.end() - 1,
std::ostream_iterator< IPAddr >(os, ", "));
return os << rpr.ips.back() << ")";