示例#1
0
        public DnsServerSettings AsDnsServerSettings()
        {
            DnsServerSettings settings = new DnsServerSettings();

            settings.Address           = this.Address;
            settings.Port              = this.Port;
            settings.MaxQuestionCount  = this.MaxQuestionCount;
            settings.MaxRequestSize    = this.MaxRequestSize;
            settings.DefaultTTL        = this.DefaultTTL;
            settings.ResolutionMode    = this.ResolutionMode;
            settings.TcpServerSettings = this.TcpServerSettings.AsSocketServerSettings();
            settings.UdpServerSettings = this.UdpServerSettings.AsSocketServerSettings();
            return(settings);
        }
示例#2
0
 public DnsResponder(IDnsStore store, DnsServerSettings settings)
 {
     if (store == null)
     {
         throw new ArgumentNullException("store");
     }
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     
     m_store = store;
     m_settings = settings;
 }
示例#3
0
        public DnsServerSettings AsDnsServerSettings()
        {
            DnsServerSettings settings = new DnsServerSettings();
            settings.Address = this.Address;
            settings.Port = this.Port;
            settings.MaxQuestionCount = this.MaxQuestionCount;
            settings.MaxRequestSize = this.MaxRequestSize;
            settings.DefaultTTL = this.DefaultTTL;
            settings.ResolutionMode = this.ResolutionMode;
            settings.TcpServerSettings = this.TcpServerSettings.AsSocketServerSettings();
            settings.UdpServerSettings = this.UdpServerSettings.AsSocketServerSettings();
            return settings;

        }
示例#4
0
        public DnsResponder(IDnsStore store, DnsServerSettings settings)
        {
            if (store == null)
            {
                throw new ArgumentNullException("store");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            m_store    = store;
            m_settings = settings;
        }
示例#5
0
        public DnsServer(IDnsStore store, DnsServerSettings settings)
        {
            if (store == null || settings == null)
            {
                throw new ArgumentNullException();
            }

            m_settings = settings;
            m_store    = store;

            m_tcpResponder = new DnsResponderTCP(this.Store, this.Settings);
            m_udpResponder = new DnsResponderUDP(this.Store, this.Settings);

            m_tcpResponder.Server.Error += InvokeError;
            m_udpResponder.Server.Error += InvokeError;
        }
示例#6
0
        public DnsServer(IDnsStore store, DnsServerSettings settings)
        {
            if (store == null || settings == null)
            {
                throw new ArgumentNullException();
            }

            m_settings = settings;
            m_store = store;

            m_tcpResponder = new DnsResponderTCP(this.Store, this.Settings);
            m_udpResponder = new DnsResponderUDP(this.Store, this.Settings);

            m_tcpResponder.Server.Error += InvokeError;
            m_udpResponder.Server.Error += InvokeError;
        }
示例#7
0
 public DnsResponderUDP(IDnsStore store, DnsServerSettings settings)
     : base(store, settings)
 {
     m_server = new DnsUdpServer(this.Settings.Endpoint, this.Settings.UdpServerSettings, this);
 }
示例#8
0
 public DnsResponderTCP(IDnsStore store, DnsServerSettings settings)
     : base(store, settings)
 {
     m_tcpServer = new TcpServer <DnsTcpContext>(this.Settings.Endpoint, this.Settings.TcpServerSettings, this);
 }