add SockAddr::isMCast() and capacity()

This commit is contained in:
Michael Davidsaver
2021-09-08 10:07:29 -07:00
parent 923c423055
commit 1040e87f39
3 changed files with 16 additions and 4 deletions
+11
View File
@@ -350,6 +350,17 @@ bool SockAddr::isLO() const
}
}
bool SockAddr::isMCast() const
{
switch(store.sa.sa_family) {
case AF_INET: return IN_MULTICAST(store.in.sin_addr.s_addr);
#ifdef AF_INET6
case AF_INET6: return IN6_IS_ADDR_MULTICAST(&store.in6.sin6_addr);
#endif
default: return false;
}
}
std::string SockAddr::tostring() const
{
std::ostringstream strm;