diff --git a/OnlineUserPool.csproj b/OnlineUserPool.csproj index 3084aa6..161f390 100644 --- a/OnlineUserPool.csproj +++ b/OnlineUserPool.csproj @@ -2,12 +2,12 @@ WinExe - netcoreapp3.1 true + net6.0-windows - + diff --git a/Services/TcpService.cs b/Services/TcpService.cs index e01f1bb..09e227a 100644 --- a/Services/TcpService.cs +++ b/Services/TcpService.cs @@ -23,9 +23,7 @@ namespace OnlineUserPool.Services public void RunServer(Action action, Action disconnected = null) { - _server = new PfTcpServer(IPAddress.Any, ConfigHelp.TcpPort, (ip, model) => { action(ip, model, this); }, - disconnected); - + _server = new PfTcpServer(IPAddress.Any, ConfigHelp.TcpPort, (ip, model) => { action(ip, model, this); },disconnected); _server.Start(); } @@ -40,6 +38,7 @@ namespace OnlineUserPool.Services if (session is { IsConnected: true }) { session.SendAsync(dgram); + dgram = null; } } @@ -180,6 +179,7 @@ namespace OnlineUserPool.Services Log.Error($"接受到的数据处理时出错:{data}\r\n{ex.Message}\r\n{ex.StackTrace}"); } + buffer = null; data = null; }