Example #1
0
        public void FromDstAddr(string dstAddr)
        {
            dstAddr = Guard.NotNullOrEmptyOrWhitespace(nameof(dstAddr), dstAddr, true);

            if (IPAddress.TryParse(dstAddr, out IPAddress address))
            {
                Guard.Same($"{nameof(address)}.{nameof(address.AddressFamily)}", AddressFamily.InterNetwork, address.AddressFamily);

                ByteValue = IPv4.ToByte();
            }
            else
            {
                ByteValue = DomainName.ToByte();
            }
        }