Example #1
0
        public static ConnectionInfo GetConnectionInfo(HostInfo hostInfo)
        {
            if (hostInfo == null)
            {
                throw new ArgumentNullException("hostInfo");
            }

            var network = new IPNetwork(hostInfo.Address, hostInfo.HostName.IPInformation.PrefixLength.Value);
            var result = new ConnectionInfo(hostInfo.Address, network);
            return result;
        }
Example #2
0
        public ConnectionInfo(IPAddress address, IPNetwork network)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }
            if (network == null)
            {
                throw new ArgumentNullException("network");
            }

            m_address = address;
            m_network = network;
        }