From 7a25b23251871beccf77947fb1ff45c36977f29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jurczyk?= Date: Thu, 4 Jul 2024 19:58:24 +0200 Subject: [PATCH] Serialization changes, changed to net8.0 --- .github/workflows/dotnet-core.yml | 2 +- Core/LocalAdmin.cs | 2 +- Core/TcpServer.cs | 5 ++--- LocalAdmin V2.csproj | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 4a51b18..75bb64d 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, windows-latest] - framework: ['7.0'] + framework: ['8.0'] include: - os: ubuntu-20.04 target: linux-x64 diff --git a/Core/LocalAdmin.cs b/Core/LocalAdmin.cs index e05e41e..2acaa63 100644 --- a/Core/LocalAdmin.cs +++ b/Core/LocalAdmin.cs @@ -30,7 +30,7 @@ namespace LocalAdmin.V2.Core; public sealed class LocalAdmin : IDisposable { - public const string VersionString = "2.5.14"; + public const string VersionString = "2.5.15"; private const ushort DefaultPort = 7777; private static readonly ConcurrentQueue InputQueue = new(); diff --git a/Core/TcpServer.cs b/Core/TcpServer.cs index ccb4388..dc0270d 100644 --- a/Core/TcpServer.cs +++ b/Core/TcpServer.cs @@ -58,6 +58,7 @@ public void Start() } _client = _listener.EndAcceptTcpClient(result); + _client.NoDelay = true; _client.ReceiveBufferSize = LocalAdmin.Configuration!.SlToLaBufferSize; _client.SendBufferSize = LocalAdmin.Configuration.LaToSlBufferSize; @@ -103,9 +104,7 @@ public void Start() continue; } - var length = (lengthBuffer[0] << 24) | (lengthBuffer[1] << 16) | - (lengthBuffer[2] << 8) | lengthBuffer[3]; - + var length = MemoryMarshal.Cast(lengthBuffer)[0]; var buffer = ArrayPool.Shared.Rent(length); while (_client.Available < length) diff --git a/LocalAdmin V2.csproj b/LocalAdmin V2.csproj index f77385e..4abacbf 100644 --- a/LocalAdmin V2.csproj +++ b/LocalAdmin V2.csproj @@ -2,8 +2,8 @@ Exe true - net7.0-windows - net7.0 + net8.0-windows + net8.0 app.manifest 10 enable