{"record":{"id":"577076e344fc86b0","repo":"shadowsocks/shadowsocks-windows","slug":"timeout-is-invalid-it-should-not-exceed-0","errorCode":null,"errorMessage":"Timeout is invalid, it should not exceed {0}","messagePattern":"Timeout is invalid, it should not exceed (.+?)","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"shadowsocks-csharp/Model/Configuration.cs","lineNumber":380,"sourceCode":"                throw new ArgumentException(I18N.GetString(\"Port can't be 8123\"));\r\n        }\r\n\r\n        private static void CheckPassword(string password)\r\n        {\r\n            if (string.IsNullOrEmpty(password))\r\n                throw new ArgumentException(I18N.GetString(\"Password can not be blank\"));\r\n        }\r\n\r\n        public static void CheckServer(string server)\r\n        {\r\n            if (string.IsNullOrEmpty(server))\r\n                throw new ArgumentException(I18N.GetString(\"Server IP can not be blank\"));\r\n        }\r\n\r\n        public static void CheckTimeout(int timeout, int maxTimeout)\r\n        {\r\n            if (timeout <= 0 || timeout > maxTimeout)\r\n                throw new ArgumentException(\r\n                    I18N.GetString(\"Timeout is invalid, it should not exceed {0}\", maxTimeout));\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":362,"sourceCodeEnd":385,"githubUrl":"https://github.com/shadowsocks/shadowsocks-windows/blob/891d971682eefcaa2e640258d3b352a3ad3b2233/shadowsocks-csharp/Model/Configuration.cs#L362-L385","documentation":"ArgumentException thrown by CheckTimeout when timeout <= 0 or timeout > maxTimeout. The timeout governs socket I/O idle limits; an invalid value either disables timeouts (<=0) or exceeds the configured ceiling (maxTimeout). The {0} placeholder is filled with maxTimeout at throw time via I18N.GetString.","triggerScenarios":"Config timeout set to 0 or a negative value. Timeout larger than the maxTimeout passed in (often derived from the cipher's safe range). A hand-edited gui-config.json with an out-of-range timeout.","commonSituations":"Copying a server config that set a very large timeout. Resetting the timeout to 0 by accident. A build where maxTimeout was lowered but old configs exceed it.","solutions":["Set the timeout to a positive value within maxTimeout (commonly a few hundred seconds).","If a larger timeout is required, confirm maxTimeout allows it or raise the cap in your build.","Use the GUI spinner which clamps the input to the valid range."],"exampleFix":"// before\nConfiguration.CheckTimeout(0, maxTimeout: 600);\n\n// after\nConfiguration.CheckTimeout(120, maxTimeout: 600);","handlingStrategy":"validation","validationCode":"if (timeout <= 0 || timeout > maxTimeout) {\n    // surface error in UI before calling CheckTimeout\n    return;\n}","typeGuard":null,"tryCatchPattern":"try { Configuration.CheckTimeout(timeout, maxTimeout); }\ncatch (ArgumentException ex) { /* show ex.Message, keep the dialog open */ }","preventionTips":["Use a numeric up-down clamped to 1..maxTimeout.","Display maxTimeout in the field label so the ceiling is obvious."],"tags":["configuration","validation","timeout"],"backgroundTag":null,"analyzedSha":"891d971682eefcaa2e640258d3b352a3ad3b2233","analyzedAt":"2026-08-13T10:12:34.434Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}