Esempio n. 1
0
            /// <summary>
            /// AJAX数据加载
            /// </summary>
            /// <typeparam name="ajaxType">AJAX调用类型</typeparam>
            /// <typeparam name="valueType">调用参数类型</typeparam>
            /// <param name="ajax">AJAX调用</param>
            /// <param name="parameter">参数值</param>
            /// <param name="isPool">是否使用WEB页面池</param>
            /// <returns>HTTP响应,失败返回null</returns>
            public response Load <ajaxType, valueType>(ajaxType ajax, ref valueType parameter, bool isPool)
                where ajaxType : webView.view, webView.IWebView
                where valueType : struct
            {
                socketBase socket = this.socket;

                try
                {
                    ajax.Socket       = socket;
                    ajax.DomainServer = domainServer;
                    if (ajax.LoadHeader(SocketIdentity, request, ref isPool))
                    {
                        ajax.form = form;
                        if (ajax.ParseParameter(ref parameter))
                        {
                            return(ajax.Response = response.Get());
                        }
                    }
                }
                catch (Exception error)
                {
                    log.Error.Add(error, null, false);
                }
                if (socket.ResponseError(SocketIdentity, response.state.ServerError500) && isPool)
                {
                    typePool <ajaxType> .PushNotNull(ajax);
                }
                return(null);
            }
Esempio n. 2
0
 internal void Set(webCall.call webCall, socketBase socket, domainServer domainServer, long socketIdentity, requestHeader request, call call)
 {
     this.webCall        = webCall;
     this.socket         = socket;
     this.domainServer   = domainServer;
     this.SocketIdentity = socketIdentity;
     this.request        = request;
     this.call           = call;
 }
Esempio n. 3
0
 private void push()
 {
     webCall      = null;
     socket       = null;
     domainServer = null;
     request      = null;
     form         = null;
     call         = null;
     typePool <loader> .PushNotNull(this);
 }
Esempio n. 4
0
            /// <summary>
            /// WEB视图表单加载
            /// </summary>
            /// <param name="form">HTTP请求表单</param>
            internal void Load(requestForm form)
            {
                long       identity = SocketIdentity;
                socketBase socket   = this.socket;

                try
                {
                    this.form = form;
                    webCall.CallAjax(call.CallIndex, this);
                    return;
                }
                catch (Exception error)
                {
                    log.Error.Add(error, null, false);
                }
                finally { push(); }
                socket.ResponseError(identity, response.state.ServerError500);
            }
Esempio n. 5
0
 /// <summary>
 /// WebSocket调用加载
 /// </summary>
 /// <param name="domainServer">域名服务</param>
 /// <param name="socket">HTTP套接字接口设置</param>
 /// <param name="socketIdentity">套接字操作编号</param>
 internal void Load(domainServer domainServer, socketBase socket, long socketIdentity)
 {
     Socket = socket;
     try
     {
         if (!socket.ResponseWebSocket101(ref socketIdentity, this))
         {
             return;
         }
         DomainServer   = domainServer;
         SocketIdentity = socketIdentity;
         requestHeader  = socket.RequestHeader;
         if (loadSocket())
         {
             return;
         }
     }
     catch (Exception error)
     {
         log.Error.Add(error, null, false);
     }
     socket.ResponseError(socketIdentity, net.tcp.http.response.state.ServerError500);
 }