Example #1
0
        /// <summary>
        /// 接收到一个包
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="msg"></param>
        protected override void ChannelRead0(IChannelHandlerContext ctx, byte[] msg)
        {
            Peer?.SendAsync(msg);
            //log.LogInformation($"{nameof(ChannelRead0)}: {BitConverter.ToString(msg).Replace("-"," ")}");

            hexDumpService.Add(msg, true);
        }
Example #2
0
 /// <summary>
 /// 接收到一个包
 /// </summary>
 /// <param name="ctx"></param>
 /// <param name="msg"></param>
 protected override void ChannelRead0(IChannelHandlerContext ctx, byte[] msg)
 {
     if (Peer == null)
     {
         ctx.CloseAsync();
     }
     else
     {
         Peer.SendAsync(msg);
     }
     hexDumpService.Add(msg, false);
 }