Пример #1
0
        public void PingFrameShouldMatch()
        {
            writer.WritePingAsync(this.ctx.Object, false, 1234567, this.ctx.Object.NewPromise());
            this.ReadFrames();

            var captor = new ArgumentCaptor <long>();

            this.listener.Verify(
                x => x.OnPingRead(
                    It.Is <IChannelHandlerContext>(c => c == this.ctx.Object),
                    It.Is <long>(v => captor.Capture(v))));
            Assert.Equal(1234567, captor.GetValue());
        }
Пример #2
0
 public Task WritePingAsync(IChannelHandlerContext ctx, bool ack, long data, IPromise promise)
 {
     if (ack)
     {
         _logger.LogPingAck(Direction.Outbound, ctx, data);
     }
     else
     {
         _logger.LogPing(Direction.Outbound, ctx, data);
     }
     return(_writer.WritePingAsync(ctx, ack, data, promise));
 }
Пример #3
0
 public virtual Task WritePingAsync(IChannelHandlerContext ctx, bool ack, long data, IPromise promise)
 {
     return(_innerWriter.WritePingAsync(ctx, ack, data, promise));
 }