From 3dbceb35b93ac7af67ab5e372a38edf4b3913aa7 Mon Sep 17 00:00:00 2001 From: smartwyy <645583145@qq.com> Date: Mon, 27 May 2024 15:56:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AF=E8=B0=83=E8=AF=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Car/Codec/Encoder.cs | 5 +++-- Service/Car/Server/CarServer.cs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Service/Car/Codec/Encoder.cs b/Service/Car/Codec/Encoder.cs index f64cf63..ea80435 100644 --- a/Service/Car/Codec/Encoder.cs +++ b/Service/Car/Codec/Encoder.cs @@ -23,7 +23,8 @@ public class Encoder : MessageToByteEncoder protected override void Encode(IChannelHandlerContext context, BaseMsg obj, IByteBuffer output) { byte[] bytes = obj.ToBytes(); - output.WriteBytes(bytes); - output.WriteBytes(CarConst.EndChar); + List list = new List(bytes); + list.AddRange(CarConst.EndChar); + output.WriteBytes(list.ToArray()); } } \ No newline at end of file diff --git a/Service/Car/Server/CarServer.cs b/Service/Car/Server/CarServer.cs index 15ac747..78956c4 100644 --- a/Service/Car/Server/CarServer.cs +++ b/Service/Car/Server/CarServer.cs @@ -37,6 +37,7 @@ public class CarServer : TcpServer public CarServer() : base() { this.ChannelInActiveAction = Clean; + this.LogLevel = DotNetty.Handlers.Logging.LogLevel.TRACE; } ///