forked from powerfun/udpservice
NetCoreServer版本升级到6.7.0
This commit is contained in:
parent
9f134a2d64
commit
b84409a5fd
@ -2,12 +2,12 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GeoJSON.Net" Version="0.1.51" />
|
||||
<PackageReference Include="NetCoreServer" Version="3.0.22" />
|
||||
<PackageReference Include="NetCoreServer" Version="6.7.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="Prism.Unity" Version="7.2.0.1422" />
|
||||
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
|
||||
|
||||
@ -23,9 +23,7 @@ namespace OnlineUserPool.Services
|
||||
|
||||
public void RunServer(Action<IPEndPoint, ReceiveModel, IService> action, Action<EndPoint> 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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user