InetAddress类就是封装了IPv4地址和IPv6地址,比较简单。这是muduo库中少有的值语义的类,所以继承的是copyable。实际上copyable只是强调可以拷贝,并没有实际意义。...InetAddress::InetAddress(uint16_t port, bool loopbackOnly, bool ipv6)
{
static_assert(offsetof(InetAddress..., addr6_) == 0, "addr6_ offset 0");
static_assert(offsetof(InetAddress, addr_) == 0, "addr_ offset...::InetAddress(StringArg ip, uint16_t port, bool ipv6)
{
if (ipv6)
{
memZero(&addr6_, sizeof addr6...::resolve(StringArg hostname, InetAddress* out)
{
assert(out !