public AuthoritativeResolutionSettings AsAuthoritativeResolutionSettings()
        {
            AuthoritativeResolutionSettings settings = new AuthoritativeResolutionSettings();
            settings.Cache = this.Cache;
            settings.TimeoutMilliseconds = this.TimeoutMilliseconds;
            settings.DnsResolutionPort = this.DnsResolutionPort;
            
            DnsIPEndpointSettings[] endpoints = new DnsIPEndpointSettings[this.PrimaryNameServers.Count];

            int i = 0; 
            foreach (DnsIPEndpointElement element in this.PrimaryNameServers)
            {
                endpoints[i] = element.AsDnsIPEndpointSettings();
                i++;
            }
            settings.PrimaryNameServer = endpoints;
            
            return settings;
        }
        public AuthoritativeResolutionSettings AsAuthoritativeResolutionSettings()
        {
            AuthoritativeResolutionSettings settings = new AuthoritativeResolutionSettings();

            settings.Cache = this.Cache;
            settings.TimeoutMilliseconds = this.TimeoutMilliseconds;
            settings.DnsResolutionPort   = this.DnsResolutionPort;

            DnsIPEndpointSettings[] endpoints = new DnsIPEndpointSettings[this.PrimaryNameServers.Count];

            int i = 0;

            foreach (DnsIPEndpointElement element in this.PrimaryNameServers)
            {
                endpoints[i] = element.AsDnsIPEndpointSettings();
                i++;
            }
            settings.PrimaryNameServer = endpoints;

            return(settings);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructs the resolver from settings.
        /// </summary>        
        public AuthoritativeRecordResolver(AuthoritativeResolutionSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings"); 
            }

            if (settings.TimeoutMilliseconds < 1)
            {
                throw new ArgumentOutOfRangeException("TimeoutMilliseconds"); 
            }

            if (settings.DnsResolutionPort < 1)
            {
                throw new ArgumentOutOfRangeException("DnsResolutionPort"); 
            }

            m_doCache = settings.Cache;
            m_timeoutMilliseconds = new TimeSpan(0, 0, 0, 0, settings.TimeoutMilliseconds);
            m_dnsResolutionPort = settings.DnsResolutionPort;
            ParsePrimaryNameServers(settings.PrimaryNameServer);            
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructs the resolver from settings.
        /// </summary>
        public AuthoritativeRecordResolver(AuthoritativeResolutionSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            if (settings.TimeoutMilliseconds < 1)
            {
                throw new ArgumentOutOfRangeException("TimeoutMilliseconds");
            }

            if (settings.DnsResolutionPort < 1)
            {
                throw new ArgumentOutOfRangeException("DnsResolutionPort");
            }

            m_doCache             = settings.Cache;
            m_timeoutMilliseconds = new TimeSpan(0, 0, 0, 0, settings.TimeoutMilliseconds);
            m_dnsResolutionPort   = settings.DnsResolutionPort;
            ParsePrimaryNameServers(settings.PrimaryNameServer);
        }