From 0323b616f4ccae87268ef62778c978dd1d608af3 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 27 May 2024 00:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B5=81=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NetWork/SourceMode/TcpSaeaServer_SourceMode.cs | 4 ++++ .../NetWork/SourceMode/TcpSaeaServer_SourceMode.cs | 4 ++++ .../NetWork/TcpSaeaServer.cs | 3 +++ 3 files changed, 11 insertions(+) diff --git a/NetLib/HaoYueNet.ServerNetwork/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs b/NetLib/HaoYueNet.ServerNetwork/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs index fc30b71..26dba2b 100644 --- a/NetLib/HaoYueNet.ServerNetwork/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs +++ b/NetLib/HaoYueNet.ServerNetwork/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs @@ -414,6 +414,10 @@ namespace HaoYueNet.ServerNetwork } else { + //尝试性,清理数据 + token.memoryStream.SetLength(0); + token.memoryStream.Seek(0, SeekOrigin.Begin); + CloseClientSocket(e); } } diff --git a/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs b/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs index 4dd6f77..4eb1c00 100644 --- a/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs +++ b/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/SourceMode/TcpSaeaServer_SourceMode.cs @@ -1,6 +1,7 @@ //using HunterProtobufCore; using System; using System.Collections.Generic; +using System.IO; using System.Net; using System.Net.Sockets; using System.Threading; @@ -416,6 +417,9 @@ namespace HaoYueNet.ServerNetwork.Standard2 } else { + //尝试性,清理数据 + token.memoryStream.SetLength(0); + token.memoryStream.Seek(0, SeekOrigin.Begin); CloseClientSocket(e); } } diff --git a/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/TcpSaeaServer.cs b/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/TcpSaeaServer.cs index be23701..54b7675 100644 --- a/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/TcpSaeaServer.cs +++ b/NetLib_Standard2/HaoYueNet.ServerNetwork.Standard2/NetWork/TcpSaeaServer.cs @@ -457,6 +457,9 @@ namespace HaoYueNet.ServerNetwork.Standard2 } else { + //尝试性,清理数据 + token.memoryStream.SetLength(0); + token.memoryStream.Seek(0, SeekOrigin.Begin); CloseClientSocket(e); } }