/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="socket">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> /// <returns>是否成功</returns> public override bool DoCommand(int index, AutoCSer.Net.TcpOpenSimpleServer.ServerSocket socket, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { _p2 outputParameter = new _p2(); Value.Add(inputParameter.left, inputParameter.right, socket.GetCallback <_p2, int>(_c0, ref outputParameter)); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); default: return(false); } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter, true)) { (_s0 /**/.Pop() ?? new _s0()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalStreamServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter, true)) { _p2 _outputParameter_ = new _p2(); int Return; Return = Value.add(inputParameter.p0, inputParameter.p1); _outputParameter_.Return = Return; sender.Push(_c0, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter, true)) { _p4 _outputParameter_ = new _p4(); AutoCSer.TestCase.TcpServerPerformance.Add Return; Return = Value.addAsynchronous(inputParameter.p0, inputParameter.p1); _outputParameter_.Return = Return; sender.Push(_c1, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="socket">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> /// <returns>是否成功</returns> public override bool DoCommand(int index, AutoCSer.Net.TcpInternalSimpleServer.ServerSocket socket, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter, true)) { _p2 outputParameter = new _p2(); Value.addAsynchronous(inputParameter.p0, inputParameter.p1, socket.GetCallback <_p2, int>(_c0, ref outputParameter)); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter, true)) { _p2 _outputParameter_ = new _p2(); int Return; Return = Value.addSynchronous(inputParameter.p0, inputParameter.p1); _outputParameter_.Return = Return; return(socket.Send(_c1, ref _outputParameter_)); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); default: return(false); } }
protected override bool call(AutoCSer.WebView.CallBase call) { switch (call.CallMethodIndex) { case 2: { _p1 parameter = new _p1(); if (call.ParseParameter(ref parameter)) { ((AutoCSer.TestCase.WebPerformance.WebCallAsynchronous)call).Xor(parameter.left, parameter.right); return(true); } } return(false); default: return(false); } }
protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { switch (callIndex) { case 0: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.Web.Ajax.Example ajax = (AutoCSer.Web.Ajax.Example)page; _p2 outputParameter = new _p2 { }; try { outputParameter.Return = ajax.GetCode(inputParameter.file); } finally { responseAjax(ajax, ref outputParameter); } return(true); } } return(false); case 1: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.Web.Ajax.TestCase ajax = (AutoCSer.Web.Ajax.TestCase)page; _p2 outputParameter = new _p2 { }; try { outputParameter.Return = ajax.GetCode(inputParameter.file); } finally { responseAjax(ajax, ref outputParameter); } return(true); } } return(false); default: return(false); } }
protected override bool callAjax(int callIndex, AutoCSer.WebView.AjaxBase page) { switch (callIndex) { case 0: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.TestCase.WebPerformance.Ajax.Call ajax = (AutoCSer.TestCase.WebPerformance.Ajax.Call)page; _p2 outputParameter = new _p2 { }; try { outputParameter.Return = ajax.Add(inputParameter.left, inputParameter.right); } finally { responseAjax(ajax, ref outputParameter); } return(true); } } return(false); case 1: { _p1 inputParameter = new _p1(); if (page.ParseParameter(ref inputParameter)) { AutoCSer.TestCase.WebPerformance.Ajax.Call ajax = (AutoCSer.TestCase.WebPerformance.Ajax.Call)page; _p2 outputParameter = new _p2 { }; _a1 returnCallbak = new _a1 { Ajax = ajax, Parameter = outputParameter }; ajax.Xor(inputParameter.left, inputParameter.right, returnCallbak.Callback); return(true); } } return(false); default: return(false); } }
protected override bool call(AutoCSer.WebView.CallBase call, ref AutoCSer.UnmanagedStream responseStream) { switch (call.CallMethodIndex) { case 1: { _p1 parameter = new _p1(); if (call.ParseParameter(ref parameter)) { AutoCSer.TestCase.WebPerformance.WebCall value = (AutoCSer.TestCase.WebPerformance.WebCall)call; value.Add(parameter.left, parameter.right); repsonseCall(value, ref responseStream); return(true); } } return(false); default: return(false); } }
set => SetProperty(ref _p1, value);
/// <summary> /// AJAX调用 /// </summary> /// <param name="callIndex"></param> /// <param name="loader"></param> protected override void callAjax(int callIndex, fastCSharp.code.cSharp.ajax.loader loader) { switch (callIndex) { case 0: { fastCSharp.demo.chatWeb.ajax.pub view = fastCSharp.typePool <fastCSharp.demo.chatWeb.ajax.pub> .Pop() ?? new fastCSharp.demo.chatWeb.ajax.pub(); _p0 parameter = new _p0(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; _a0 callback = typePool <_a0> .Pop() ?? new _a0(); callback.Parameter = parameter; view.CrawlTitle(parameter.link, callback.Get(view, response)); } } return; case 1: { fastCSharp.demo.chatWeb.ajax.pub view = fastCSharp.typePool <fastCSharp.demo.chatWeb.ajax.pub> .Pop() ?? new fastCSharp.demo.chatWeb.ajax.pub(); _p1 parameter = new _p1(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; try { parameter.Return = view.PasteImage(ref parameter.identity); } finally { if (responseIdentity == view.ResponseIdentity) { view.AjaxResponse(ref parameter, ref response); } else { view.AjaxResponse(ref response); } } } } return; case 2: { fastCSharp.demo.chatWeb.ajax.user view = fastCSharp.typePool <fastCSharp.demo.chatWeb.ajax.user> .Pop() ?? new fastCSharp.demo.chatWeb.ajax.user(); _p2 parameter = new _p2(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; try { parameter.Return = view.Login(parameter.user, ref parameter.version); } finally { if (responseIdentity == view.ResponseIdentity) { view.AjaxResponse(ref parameter, ref response); } else { view.AjaxResponse(ref response); } } } } return; case 3: { fastCSharp.demo.chatWeb.ajax.user view = fastCSharp.typePool <fastCSharp.demo.chatWeb.ajax.user> .Pop() ?? new fastCSharp.demo.chatWeb.ajax.user(); _p3 parameter = new _p3(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; try { view.Logout(parameter.user); } finally { view.AjaxResponse(ref response); } } } return; case 4: { fastCSharp.demo.chatWeb.ajax.user view = fastCSharp.typePool <fastCSharp.demo.chatWeb.ajax.user> .Pop() ?? new fastCSharp.demo.chatWeb.ajax.user(); _p4 parameter = new _p4(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; try { view.Send(parameter.user, parameter.message, parameter.users); } finally { view.AjaxResponse(ref response); } } } return; case 5: loader.LoadView(fastCSharp.typePool <fastCSharp.demo.chatWeb.chat> .Pop() ?? new fastCSharp.demo.chatWeb.chat(), true); return; case 6: loader.LoadView(fastCSharp.typePool <fastCSharp.demo.chatWeb.poll> .Pop() ?? new fastCSharp.demo.chatWeb.poll(), true); return; case 8 - 1: pubError(loader); return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter, true)) { _p2 outputParameter = new _p2(); AutoCSer.Web.SearchServer.Server /**/.TcpStaticServer._M1(inputParameter.p0, sender.GetCallback <_p2, AutoCSer.Web.SearchServer.SearchItem[]>(_c1, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p4 _outputParameter_ = new _p4(); bool Return; Return = AutoCSer.Web.SearchServer.Server /**/.TcpStaticServer._M2(sender, inputParameter.p2, inputParameter.p3, inputParameter.p0, ref inputParameter.p1); if (Return) { sender.SetVerifyMethod(); } _outputParameter_.p0 = inputParameter.p1; _outputParameter_.Return = Return; sender.Push(_c2, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s2 /**/.Pop() ?? new _s2()).Set(sender, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } } private static readonly AutoCSer.Net.TcpServer.OutputInfo _c1 = new AutoCSer.Net.TcpServer.OutputInfo { OutputParameterIndex = 2, IsBuildOutputThread = true }; private static readonly AutoCSer.Net.TcpServer.OutputInfo _c2 = new AutoCSer.Net.TcpServer.OutputInfo { OutputParameterIndex = 4, IsSimpleSerializeOutputParamter = true, IsBuildOutputThread = true }; sealed class _s2 : AutoCSer.Net.TcpStaticServer.ServerCall <_s2, _p5> { private void get(ref AutoCSer.Net.TcpServer.ReturnValue <_p6> value) { try { string Return; Return = AutoCSer.Web.SearchServer.SearchItem /**/.TcpStaticServer._M3(inputParameter.p0); value.Value.Return = Return; value.Type = AutoCSer.Net.TcpServer.ReturnType.Success; } catch (Exception error) { value.Type = AutoCSer.Net.TcpServer.ReturnType.ServerException; Sender.AddLog(error); } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpOpenServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p2 _outputParameter_ = new _p2(); bool Return; Return = Value.login(sender, inputParameter.userName); if (Return) { sender.SetVerifyMethod(); } _outputParameter_.Return = Return; sender.Push(_c0, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { (_s1 /**/.Pop() ?? new _s1()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s2 /**/.Pop() ?? new _s2()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 3: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { _p4 outputParameter = new _p4(); Value.getUser(sender, sender.GetCallback <_p4, AutoCSer.TestCase.ChatData.UserLogin>(_c3, ref outputParameter)); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 4: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { _p5 outputParameter = new _p5(); Value.getMessage(sender, sender.GetCallback <_p5, AutoCSer.TestCase.ChatData.Message>(_c4, ref outputParameter)); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter, true)) { (_s0 /**/.Pop() ?? new _s0()).Set(sender, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p4 _outputParameter_ = new _p4(); bool Return; Return = AutoCSer.Web.SearchServer.Server /**/.TcpStaticServer._M2(sender, inputParameter.p2, inputParameter.p0, ref inputParameter.p1); if (Return) { sender.SetVerifyMethod(); } _outputParameter_.p0 = inputParameter.p1; _outputParameter_.Return = Return; sender.Push(_c2, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s2 /**/.Pop() ?? new _s2()).Set(sender, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 4: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p7 inputParameter = new _p7(); if (sender.DeSerialize(ref data, ref inputParameter, true)) { (_s4 /**/.Pop() ?? new _s4()).Set(sender, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s1 /**/.Pop() ?? new _s1()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.Queue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { _p3 outputParameter = new _p3(); _s2 serverCall = _s2 /**/.Pop() ?? new _s2(); serverCall.AsynchronousCallback = sender.GetCallback <_p3, AutoCSer.Net.TcpRegister.ServerLog>(_c2, ref outputParameter); serverCall.Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.QueueLink); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 3: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p4 inputParameter = new _p4(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s3 /**/.Pop() ?? new _s3()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.Queue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpOpenServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p2 _outputParameter_ = new _p2(); int Return; Return = Value.add(inputParameter.left, inputParameter.right); _outputParameter_.Return = Return; sender.Push(_c0, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p4 outputParameter = new _p4(); Value.addAsynchronous(inputParameter.left, inputParameter.right, sender.GetCallback <_p4, AutoCSer.TestCase.TcpServerPerformance.Add>(_c1, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p4 _outputParameter_ = new _p4(); AutoCSer.TestCase.TcpServerPerformance.Add Return; Return = Value.addSynchronous(inputParameter.left, inputParameter.right); _outputParameter_.Return = Return; sender.Push(_c2, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 3: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s3 /**/.Pop() ?? new _s3()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 4: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s4 /**/.Pop() ?? new _s4()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpTask, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 5: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s5 /**/.Pop() ?? new _s5()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; case 6: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s6 /**/.Pop() ?? new _s6()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.ThreadPool, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.Log(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p2 outputParameter = new _p2(); Value.append(inputParameter.p0, sender.GetCallback <_p2, ulong>(_c0, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s1 /**/.Pop() ?? new _s1()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.Queue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p6 outputParameter = new _p6(); Value.read(inputParameter.p0, inputParameter.p1, sender.GetCallback <_p6, AutoCSer.DiskBlock.ClientBuffer>(_c2, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// AJAX调用 /// </summary> /// <param name="callIndex"></param> /// <param name="loader"></param> protected override void callAjax(int callIndex, fastCSharp.code.cSharp.ajax.loader loader) { switch (callIndex) { case 0: { fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing view = fastCSharp.typePool <fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing> .Pop() ?? new fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing(); _p0 parameter = new _p0(); fastCSharp.net.tcp.http.response response = loader.Load(view, true); if (response != null) { int responseIdentity = view.ResponseIdentity; try { parameter.Return = view.Start(); } finally { if (responseIdentity == view.ResponseIdentity) { view.AjaxResponse(ref parameter, ref response); } else { view.AjaxResponse(ref response); } } } } return; case 1: { fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing view = fastCSharp.typePool <fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing> .Pop() ?? new fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing(); _p1 parameter = new _p1(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; try { parameter.Return = view.Add(parameter.left, parameter.right); } finally { if (responseIdentity == view.ResponseIdentity) { view.AjaxResponse(ref parameter, ref response); } else { view.AjaxResponse(ref response); } } } } return; case 2: { fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing view = fastCSharp.typePool <fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing> .Pop() ?? new fastCSharp.demo.loadBalancingTcpCommandWeb.ajax.loadBalancing(); _p2 parameter = new _p2(); fastCSharp.net.tcp.http.response response = loader.Load(view, ref parameter, true); if (response != null) { int responseIdentity = view.ResponseIdentity; _a2 callback = typePool <_a2> .Pop() ?? new _a2(); callback.Parameter = parameter; view.Xor(parameter.left, parameter.right, callback.Get(view, response)); } } return; case 3: loader.LoadView(fastCSharp.typePool <fastCSharp.demo.loadBalancingTcpCommandWeb.webView> .Pop() ?? new fastCSharp.demo.loadBalancingTcpCommandWeb.webView(), true); return; case 5 - 1: pubError(loader); return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="socket">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> /// <returns>是否成功</returns> public override bool DoCommand(int index, AutoCSer.Net.TcpOpenSimpleServer.ServerSocket socket, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { _p2 outputParameter = new _p2(); Value.addAsynchronous(inputParameter.left, inputParameter.right, socket.GetCallback <_p2, int>(_c0, ref outputParameter)); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { (_s1 /**/.Pop() ?? new _s1()).Set(socket, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue, ref inputParameter); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { _p2 _outputParameter_ = new _p2(); int Return; Return = Value.addSynchronous(inputParameter.left, inputParameter.right); _outputParameter_.Return = Return; return(socket.Send(_c2, ref _outputParameter_)); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); case 3: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { (_s3 /**/.Pop() ?? new _s3()).Set(socket, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpTask, ref inputParameter); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); case 4: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { (_s4 /**/.Pop() ?? new _s4()).Set(socket, Value, AutoCSer.Net.TcpServer.ServerTaskType.ThreadPool, ref inputParameter); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); case 5: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (socket.DeSerialize(ref data, ref inputParameter)) { (_s5 /**/.Pop() ?? new _s5()).Set(socket, Value, AutoCSer.Net.TcpServer.ServerTaskType.Timeout, ref inputParameter); return(true); } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; socket.Log(error); } return(socket.SendOutput(returnType)); default: return(false); } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpOpenServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { _p1 outputParameter = new _p1(); _s0 serverCall = _s0 /**/.Pop() ?? new _s0(); serverCall.AsynchronousCallback = sender.GetCallback <_p1, AutoCSer.TestCase.ChatData.Message>(_c0, ref outputParameter); serverCall.Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { _p2 outputParameter = new _p2(); _s1 serverCall = _s1 /**/.Pop() ?? new _s1(); serverCall.AsynchronousCallback = sender.GetCallback <_p2, AutoCSer.TestCase.ChatData.UserLogin>(_c1, ref outputParameter); serverCall.Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s2 /**/.Pop() ?? new _s2()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 3: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { { (_s3 /**/.Pop() ?? new _s3()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue); return; } } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 4: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s4 /**/.Pop() ?? new _s4()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.TcpQueue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p2 outputParameter = new _p2(); Value.append(inputParameter.p0, sender.GetCallback <_p2, ulong>(_c0, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p4 _outputParameter_ = new _p4(); bool Return; Return = Value.verify(sender, inputParameter.p2, inputParameter.p3, inputParameter.p0, ref inputParameter.p1); if (Return) { sender.SetVerifyMethod(); } _outputParameter_.p0 = inputParameter.p1; _outputParameter_.Return = Return; sender.Push(_c1, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p6 outputParameter = new _p6(); Value.read(inputParameter.p0, inputParameter.p1, sender.GetCallback <_p6, AutoCSer.DiskBlock.ClientBuffer>(_c2, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }