Esempio n. 1
0
        /// <summary>
        /// 校验
        /// </summary>
        /// <param name="errorMsg"></param>
        /// <returns></returns>
        public bool IsValid(out string errorMsg)
        {
            errorMsg = string.Empty;
            if (!VerificationHelper.Range(this.Port, 0, 65535))
            {
                errorMsg = "端口号无效";
                return(false);
            }
            if (this.SocketType == LazynetSocketType.Websocket &&
                string.IsNullOrWhiteSpace(this.WebsocketPath))
            {
                errorMsg = "使用websocket时,WebsocketPath必填";
                return(false);
            }

            return(true);
        }