TechnitiumSoftware/DnsServer · error · ArgumentOutOfRangeException

Valid range is from 1000 to 90000.

Error message

Valid range is from 1000 to 90000.

What it means

Thrown by the TcpSendTimeout property setter when the value is below 1000ms or above 90000ms. This controls the TCP send timeout for DNS responses over TCP, ranging from 1 second to 90 seconds.

Source

Thrown at DnsServerCore/Dns/DnsServer.cs:7518

        public int ClientTimeout
        {
            get { return _clientTimeout; }
            set
            {
                if ((value < 1000) || (value > 10000))
                    throw new ArgumentOutOfRangeException(nameof(ClientTimeout), "Valid range is from 1000 to 10000.");

                _clientTimeout = value;
            }
        }

        public int TcpSendTimeout
        {
            get { return _tcpSendTimeout; }
            set
            {
                if ((value < 1000) || (value > 90000))
                    throw new ArgumentOutOfRangeException(nameof(TcpSendTimeout), "Valid range is from 1000 to 90000.");

                _tcpSendTimeout = value;
            }
        }

        public int TcpReceiveTimeout
        {
            get { return _tcpReceiveTimeout; }
            set
            {
                if ((value < 1000) || (value > 90000))
                    throw new ArgumentOutOfRangeException(nameof(TcpReceiveTimeout), "Valid range is from 1000 to 90000.");

                _tcpReceiveTimeout = value;
            }
        }

        public int QuicIdleTimeout

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Set a value between 1000 and 90000 milliseconds (e.g. 15000 for 15 seconds).
  2. Convert seconds-based config values to milliseconds.

Example fix

// before
server.TcpSendTimeout = 500; // throws, below floor

// after
server.TcpSendTimeout = 15000;
Defensive patterns

Strategy: validation

Validate before calling

int safeTimeout = Math.Clamp(value, 1000, 90000);
server.TcpSendTimeout = safeTimeout;

Type guard

static bool IsValidTcpTimeout(int ms) => ms >= 1000 && ms <= 90000;

Try / catch

try { server.TcpSendTimeout = value; }
catch (ArgumentOutOfRangeException) { server.TcpSendTimeout = 15000; }

Prevention

When it happens

Trigger: Setting server.TcpSendTimeout to an int < 1000 or > 90000.

Common situations: Passing seconds instead of milliseconds; setting an aggressive sub-second timeout; config file with a value outside the allowed band.

Related errors


AI-assisted analysis of TechnitiumSoftware/DnsServer@d0484b6c1e (2026-08-13). Data as JSON: /api/errors/4607ea789b98844b. Report an issue: GitHub.