Beispiel #1
0
        /// <summary>
        /// 处理正常的数据请求
        /// </summary>
        /// <param name="requestContext">请求上下文</param>
        private void ProcessRequest(RequestContext requestContext)
        {
            if (requestContext.Packet.IsFromClient == false)
            {
                FastTcpCommon.SetApiActionTaskResult(requestContext, this.taskSetActionTable);
                return;
            }

            var action = this.GetApiAction(requestContext);

            if (action == null)
            {
                return;
            }

            var actionContext  = new ActionContext(requestContext, action);
            var fastApiService = this.GetFastApiService(actionContext);

            if (fastApiService == null)
            {
                return;
            }

            // 执行Api行为
            fastApiService.Execute(actionContext);
            // 释放资源
            DependencyResolver.Current.TerminateService(fastApiService);
        }
        /// <summary>
        /// 处理正常的数据请求
        /// </summary>
        /// <param name="requestContext">请求上下文</param>
        private void ProcessRequest(RequestContext requestContext)
        {
            if (requestContext.Packet.IsFromClient)
            {
                FastTcpCommon.SetApiActionTaskResult(requestContext, this.taskSetActionTable);
                return;
            }

            var action = this.GetApiAction(requestContext);

            if (action == null)
            {
                return;
            }

            var actionContext = new ActionContext(requestContext, action);

            this.TryExecuteAction(actionContext);
        }