public void GoAwayFrameShouldMatch() { string text = "test"; var data = Buf(Encoding.UTF8.GetBytes(text)); writer.WriteGoAwayAsync(this.ctx.Object, STREAM_ID, ERROR_CODE, data.Slice(), this.ctx.Object.NewPromise()); this.ReadFrames(); var captor = new ArgumentCaptor <IByteBuffer>(); this.listener.Verify( x => x.OnGoAwayRead( It.Is <IChannelHandlerContext>(c => c == this.ctx.Object), It.Is <int>(id => id == STREAM_ID), It.Is <Http2Error>(v => v == ERROR_CODE), It.Is <IByteBuffer>(v => captor.Capture(v)))); Assert.Equal(data, captor.GetValue()); }
public virtual Task WriteGoAwayAsync(IChannelHandlerContext ctx, int lastStreamId, Http2Error errorCode, IByteBuffer debugData, IPromise promise) { return(_innerWriter.WriteGoAwayAsync(ctx, lastStreamId, errorCode, debugData, promise)); }
public Task WriteGoAwayAsync(IChannelHandlerContext ctx, int lastStreamId, Http2Error errorCode, IByteBuffer debugData, IPromise promise) { _logger.LogGoAway(Direction.Outbound, ctx, lastStreamId, errorCode, debugData); return(_writer.WriteGoAwayAsync(ctx, lastStreamId, errorCode, debugData, promise)); }