开启调试日志

master
smartwyy 6 months ago
parent 8ce53d328a
commit 3dbceb35b9

@ -23,7 +23,8 @@ public class Encoder : MessageToByteEncoder<BaseMsg>
protected override void Encode(IChannelHandlerContext context, BaseMsg obj, IByteBuffer output) protected override void Encode(IChannelHandlerContext context, BaseMsg obj, IByteBuffer output)
{ {
byte[] bytes = obj.ToBytes(); byte[] bytes = obj.ToBytes();
output.WriteBytes(bytes); List<byte> list = new List<byte>(bytes);
output.WriteBytes(CarConst.EndChar); list.AddRange(CarConst.EndChar);
output.WriteBytes(list.ToArray());
} }
} }

@ -37,6 +37,7 @@ public class CarServer : TcpServer<IBaseHandler, Decoder, Encoder>
public CarServer() : base() public CarServer() : base()
{ {
this.ChannelInActiveAction = Clean; this.ChannelInActiveAction = Clean;
this.LogLevel = DotNetty.Handlers.Logging.LogLevel.TRACE;
} }
/// <summary> /// <summary>

Loading…
Cancel
Save