///// <summary> ///// 获取请求表单数据[TRY+1] ///// </summary> ///// <param name="identity">HTTP操作标识</param> ///// <param name="page">WEB 页面</param> ///// <param name="type">获取请求表单数据回调类型</param> ///// <returns>是否匹配会话标识</returns> //internal override bool GetForm(long identity, AutoCSer.WebView.Page page, GetFormType type) //{ // if (Interlocked.CompareExchange(ref this.Identity, identity + 1, identity) == identity) // { // GetFormPage = page; // GetFormType = type; // tryGetForm(); // return true; // } // return false; //} /// <summary> /// 获取请求表单数据 /// </summary> /// <param name="page">WEB 页面</param> /// <param name="type">获取请求表单数据回调类型</param> internal override void GetForm(AutoCSer.WebView.Page page, GetFormType type) { ++this.Identity; GetFormPage = page; GetFormType = type; Flag |= SocketFlag.GetForm | SocketFlag.IsLoadForm; try { if (Header.Is100Continue == 0) { if (getForm()) return; } else { System.Net.Sockets.Socket socket = Socket; if (socket != null) { SendType = SendType.GetForm; Data.Set(continue100, 0, continue100.Length); Timeout = Config.GetTimeout(Data.Length); #if DOTNET2 SocketError socketError; IAsyncResult async = socket.BeginSend(continue100, 0, Data.Length, SocketFlags.None, out socketError, onSendAsyncCallback, socket); if (socketError == SocketError.Success) { if (!async.CompletedSynchronously) Http.Header.ReceiveTimeout.Push(this, socket); return; } #else sendAsyncLock.EnterSleepFlag(); sendAsyncEventArgs.SetBuffer(continue100, 0, Data.Length); if (socket.SendAsync(sendAsyncEventArgs)) { sendAsyncLock.SleepFlag = 0; Http.Header.ReceiveTimeout.Push(this, socket); sendAsyncLock.Exit(); return; } sendAsyncLock.ExitSleepFlag(); if (sendAsyncEventArgs.SocketError == SocketError.Success && sendAsyncEventArgs.BytesTransferred == Data.Length && getForm()) return; #endif } } } catch (Exception error) { Server.RegisterServer.TcpServer.Log.Exception(error, null, LogLevel.Exception | LogLevel.AutoCSer); } HeaderError(); }
///// <summary> ///// 获取请求表单数据 ///// </summary> ///// <param name="identity">HTTP操作标识</param> ///// <param name="page">WEB 页面</param> ///// <param name="type">获取请求表单数据回调类型</param> ///// <returns>是否匹配会话标识</returns> //internal abstract bool GetForm(long identity, AutoCSer.WebView.Page page, GetFormType type); /// <summary> /// 获取请求表单数据 /// </summary> /// <param name="page">WEB 页面</param> /// <param name="type">获取请求表单数据回调类型</param> internal abstract void GetForm(AutoCSer.WebView.Page page, GetFormType type);