Пример #1
0
        public Http2Stream(Http2StreamContext context)
            : base(context)
        {
            _context = context;

            _inputFlowControl = new StreamInputFlowControl(
                context.StreamId,
                context.FrameWriter,
                context.ConnectionInputFlowControl,
                context.ServerPeerSettings.InitialWindowSize,
                context.ServerPeerSettings.InitialWindowSize / 2);

            _outputFlowControl = new StreamOutputFlowControl(
                context.ConnectionOutputFlowControl,
                context.ClientPeerSettings.InitialWindowSize);

            _http2Output = new Http2OutputProducer(
                context.StreamId,
                context.FrameWriter,
                _outputFlowControl,
                context.TimeoutControl,
                context.MemoryPool,
                this,
                context.ServiceContext.Log);

            RequestBodyPipe = CreateRequestBodyPipe(context.ServerPeerSettings.InitialWindowSize);
            Output          = _http2Output;
        }
Пример #2
0
        public Http2Stream(Http2StreamContext context)
            : base(context)
        {
            _context = context;

            Output = new Http2OutputProducer(StreamId, _context.FrameWriter);
        }
Пример #3
0
        public void Initialize(Http2StreamContext context)
        {
            base.Initialize(context);

            _decrementCalled     = false;
            _completionState     = StreamCompletionFlags.None;
            InputRemaining       = null;
            RequestBodyStarted   = false;
            DrainExpirationTicks = 0;

            _context = context;

            _inputFlowControl = new StreamInputFlowControl(
                context.StreamId,
                context.FrameWriter,
                context.ConnectionInputFlowControl,
                context.ServerPeerSettings.InitialWindowSize,
                context.ServerPeerSettings.InitialWindowSize / 2);

            _outputFlowControl = new StreamOutputFlowControl(
                context.ConnectionOutputFlowControl,
                context.ClientPeerSettings.InitialWindowSize);

            _http2Output = new Http2OutputProducer(
                context.StreamId,
                context.FrameWriter,
                _outputFlowControl,
                context.MemoryPool,
                this,
                context.ServiceContext.Log);

            RequestBodyPipe = CreateRequestBodyPipe(context.ServerPeerSettings.InitialWindowSize);
            Output          = _http2Output;
        }
Пример #4
0
        public Http2Stream(Http2StreamContext context)
            : base(context)
        {
            _context           = context;
            _outputFlowControl = new Http2StreamOutputFlowControl(context.ConnectionOutputFlowControl, context.ClientPeerSettings.InitialWindowSize);

            Output = new Http2OutputProducer(context.StreamId, context.FrameWriter, _outputFlowControl, context.TimeoutControl, context.MemoryPool);
        }
Пример #5
0
        public Http2OutputProducer(Http2Stream stream, Http2StreamContext context, StreamOutputFlowControl flowControl)
        {
            _stream      = stream;
            _frameWriter = context.FrameWriter;
            _flowControl = flowControl;
            _memoryPool  = context.MemoryPool;
            _log         = context.ServiceContext.Log;

            _pipe = CreateDataPipe(_memoryPool);

            _pipeWriter = new ConcurrentPipeWriter(_pipe.Writer, _memoryPool, _dataWriterLock);
            _pipeReader = _pipe.Reader;

            // No need to pass in timeoutControl here, since no minDataRates are passed to the TimingPipeFlusher.
            // The minimum output data rate is enforced at the connection level by Http2FrameWriter.
            _flusher = new TimingPipeFlusher(_pipeWriter, timeoutControl: null, _log);

            _dataWriteProcessingTask = ProcessDataWrites();
        }
Пример #6
0
        public void Initialize(Http2StreamContext context)
        {
            base.Initialize(context);

            CanReuse             = false;
            _decrementCalled     = false;
            _completionState     = StreamCompletionFlags.None;
            InputRemaining       = null;
            RequestBodyStarted   = false;
            DrainExpirationTicks = 0;

            _context = context;

            // First time the stream is used we need to create flow control, producer and pipes.
            // When a stream is reused these types will be reset and reused.
            if (_inputFlowControl == null)
            {
                _inputFlowControl = new StreamInputFlowControl(
                    this,
                    context.FrameWriter,
                    context.ConnectionInputFlowControl,
                    context.ServerPeerSettings.InitialWindowSize,
                    context.ServerPeerSettings.InitialWindowSize / 2);

                _outputFlowControl = new StreamOutputFlowControl(
                    context.ConnectionOutputFlowControl,
                    context.ClientPeerSettings.InitialWindowSize);

                _http2Output = new Http2OutputProducer(this, context, _outputFlowControl);

                RequestBodyPipe = CreateRequestBodyPipe();

                Output = _http2Output;
            }
            else
            {
                _inputFlowControl.Reset();
                _outputFlowControl.Reset(context.ClientPeerSettings.InitialWindowSize);
                _http2Output.StreamReset();
                RequestBodyPipe.Reset();
            }
        }
Пример #7
0
 public Http2Stream(IHttpApplication<TContext> application, Http2StreamContext context)
 {
     Initialize(context);
     _application = application;
 }
 public Http2Stream(IHttpApplication <TContext> application, Http2StreamContext context)
     : base(context)
 {
     _application = application;
 }
Пример #9
0
 public Http2Stream(IHttpApplication <TContext> application, Http2StreamContext context)
 {
     InitializePooled(context, reset: true);
     _application = application;
 }