From 18898203d3392415acc45e04d484257a2189ff51 Mon Sep 17 00:00:00 2001 From: lxw Date: Fri, 17 May 2024 12:02:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=86=E6=9E=B6bug=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HybirdFrameworkCore/Utils/BitUtls.cs | 3 ++- HybirdFrameworkDriver/TcpClient/TcpClient.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HybirdFrameworkCore/Utils/BitUtls.cs b/HybirdFrameworkCore/Utils/BitUtls.cs index 74e8991..86ecac7 100644 --- a/HybirdFrameworkCore/Utils/BitUtls.cs +++ b/HybirdFrameworkCore/Utils/BitUtls.cs @@ -53,7 +53,8 @@ public static class BitUtls if (propertyType == STRING) { - return Convert.ChangeType(BytesToHexStr(bytes, start, length), propertyType); + + return Convert.ChangeType(Encoding.ASCII.GetString(bytes, start, length), propertyType); } if (propertyType == BYTEARRAY) diff --git a/HybirdFrameworkDriver/TcpClient/TcpClient.cs b/HybirdFrameworkDriver/TcpClient/TcpClient.cs index 32dca10..c44db39 100644 --- a/HybirdFrameworkDriver/TcpClient/TcpClient.cs +++ b/HybirdFrameworkDriver/TcpClient/TcpClient.cs @@ -110,7 +110,7 @@ public class TcpClient where TH : IChannelHandler Connected = false; Log.Info($"begin to connect {Host}:{Port}"); - while (Connected) + while (!Connected) { try {