From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点
---
Plugin.StandardTest/Setting/TcpServer.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/Plugin.StandardTest/Setting/TcpServer.cs b/Plugin.StandardTest/Setting/TcpServer.cs
new file mode 100644
index 0000000..25d5685
--- /dev/null
+++ b/Plugin.StandardTest/Setting/TcpServer.cs
@@ -0,0 +1,49 @@
+锘縰sing SuperSocket.SocketBase;
+using SuperSocket.SocketBase.Protocol;
+using System.Text;
+
+namespace Plugin.StandardTest.Setting
+{
+ public class DTReceiveFilter : ReceiveFilterBase<StringRequestInfo>
+ {
+ public override StringRequestInfo Filter(byte[] readBuffer, int offset, int length, bool toBeCopied, out int rest)
+ {
+ rest = 0;
+ int i = offset;
+ List<byte> bytes = new List<byte>();
+ while (i < readBuffer.Length)
+ {
+ byte b = readBuffer[i++];
+ if (b == '\n')
+ {
+ break;
+ }
+ bytes.Add(b);
+ }
+ byte[] arr = bytes.ToArray();
+ return new StringRequestInfo(DateTime.Now.ToString("yyyyMMddHHmmssfff"), Encoding.UTF8.GetString(arr), null);//sb.ToString()
+ }
+ }
+
+ public class StringParser : IRequestInfoParser<StringRequestInfo>
+ {
+
+ public StringRequestInfo ParseRequestInfo(string source)
+ {
+ return new StringRequestInfo(DateTime.Now.ToString("yyyyMMddHHmmssfff"), source, null);
+ }
+ }
+
+ public class TcpServer : AppServer<TcpSession>
+ {
+ public TcpServer() : base(new TerminatorReceiveFilterFactory("\n", Encoding.UTF8, new StringParser()))
+ {
+
+ }
+ }
+
+ public class TcpSession : AppSession<TcpSession, StringRequestInfo>
+ {
+
+ }
+}
--
Gitblit v1.9.1