Add sockaddr_storage ostream operator<< for comfortable debugging

This commit is contained in:
Gioacchino Mazzurco 2019-04-28 13:38:16 +02:00
parent 79af081f84
commit 3feb048c37
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
2 changed files with 5 additions and 5 deletions

View file

@ -162,6 +162,9 @@ std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr)
return out;
}
std::ostream& operator<<(std::ostream& o, const sockaddr_storage& addr)
{ return o << sockaddr_storage_tostring(addr); }
/* thread-safe version of inet_ntoa */
std::string rs_inet_ntoa(struct in_addr in)