Esempio n. 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());
        }
Esempio n. 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));
 }
 public virtual Task WritePingAsync(IChannelHandlerContext ctx, bool ack, long data, IPromise promise)
 {
     return(_innerWriter.WritePingAsync(ctx, ack, data, promise));
 }