コード例 #1
0
        public void WindowUpdateShouldNotBeSentAfterStreamIsClosedForUnconsumedBytes()
        {
            int dataSize = (int)(Http2CodecUtil.DefaultWindowSize * DefaultHttp2LocalFlowController.DefaultWindowUpdateRatio) + 1;

            // Don't set end-of-stream on the frame as we want to verify that we not return the unconsumed bytes in this
            // case once the stream was closed,
            ReceiveFlowControlledFrame(STREAM_ID, dataSize, 0, false);
            VerifyWindowUpdateNotSent(Http2CodecUtil.ConnectionStreamId);
            VerifyWindowUpdateNotSent(STREAM_ID);

            // Close the stream
            IHttp2Stream stream = _connection.Stream(STREAM_ID);

            stream.Close();
            Assert.Equal(Http2StreamState.Closed, stream.State);
            Assert.Null(_connection.Stream(STREAM_ID));

            // The window update for the connection should made it through but not the update for the already closed
            // stream
            VerifyWindowUpdateSent(Http2CodecUtil.ConnectionStreamId, dataSize);
            VerifyWindowUpdateNotSent(STREAM_ID);
        }
コード例 #2
0
 public void GetStreamWithoutStreamShouldReturnNull()
 {
     Assert.Null(server.Stream(100));
 }