コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }
コード例 #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);            
        }
コード例 #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);
        }