/// <summary> /// 消息超时追加到文件完毕 /// </summary> /// <param name="value"></param> /// <returns></returns> private bool OnAppendFile(AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> value) { if (value.Type == Net.TcpServer.ReturnType.Success) { reader.SetIdentity(identity); } return(true); }
/// <summary> /// ref / out 参数 测试 /// </summary> /// <returns></returns> //[AutoCSer.Metadata.TestMethod] internal static bool TestCase() { using (AutoCSer.Example.TcpOpenServer.RefOut.TcpOpenServer server = new AutoCSer.Example.TcpOpenServer.RefOut.TcpOpenServer()) { if (server.IsListen) { using (AutoCSer.Example.TcpOpenServer.TcpClient.RefOut.TcpOpenClient client = new AutoCSer.Example.TcpOpenServer.TcpClient.RefOut.TcpOpenClient()) { int right = 3, product; AutoCSer.Net.TcpServer.ReturnValue <int> sum = client.Add(2, ref right, out product); if (sum.Type != AutoCSer.Net.TcpServer.ReturnType.Success || sum.Value != 2 + 3 || right != (3 << 1) || product != 2 * 3) { return(false); } return(true); } } } //AutoCSer.Net.TcpOpenServer.ServerAttribute attribute1 = AutoCSer.Net.TcpOpenServer.ServerAttribute.GetConfig("AutoCSer.Example.TcpOpenServer.RefOut", typeof(AutoCSer.Example.TcpOpenServer.RefOut)); //AutoCSer.Net.TcpOpenServer.ServerAttribute attribute2 = AutoCSer.MemberCopy.Copyer<AutoCSer.Net.TcpOpenServer.ServerAttribute>.MemberwiseClone(attribute1); //++attribute2.Port; //using (AutoCSer.Example.TcpOpenServer.RefOut.TcpOpenServer server1 = new AutoCSer.Example.TcpOpenServer.RefOut.TcpOpenServer(attribute1)) //using (AutoCSer.Example.TcpOpenServer.RefOut.TcpOpenServer server2 = new AutoCSer.Example.TcpOpenServer.RefOut.TcpOpenServer(attribute2)) //{ // if (server1.IsListen && server2.IsListen) // { // using (AutoCSer.Example.TcpOpenServer.TcpClient.RefOut.TcpOpenClient client = new AutoCSer.Example.TcpOpenServer.TcpClient.RefOut.TcpOpenClient(null, new ClientLoadRoute(attribute1, attribute2))) // { // client._TcpClient_.Sender; // } // } //} return(false); }
/// <summary> /// 消息超时追加到文件完毕 /// </summary> /// <param name="returnValue"></param> /// <returns></returns> public override bool Callback(AutoCSer.Net.TcpServer.ReturnValue <ReturnParameter> returnValue) { return(node.OnAppendFile(returnValue)); }