System.ServiceModel.Http2Protocol.Http2Protocol.ProcessDataFrame C# (CSharp) Method

ProcessDataFrame() private method

Process Protocol Data frame.
private ProcessDataFrame ( System.ServiceModel.Http2Protocol.ProtocolFrames.DataFrame frame ) : void
frame System.ServiceModel.Http2Protocol.ProtocolFrames.DataFrame The data frame.
return void
        private void ProcessDataFrame(DataFrame frame)
        {
            if (this.OnStreamFrame != null)
            {
                Http2Stream stream = this.streamsStore.GetStreamById(frame.StreamId);
                if (stream == null)
                {
                    this.SendRST(frame.StreamId, StatusCode.InvalidStream);
                }
                else
                {
                    if (stream.Session.IsFlowControlEnabled)
                    {
                        //TODO: incomment this when server will be able to handle window update
                        //if (stream.CurrentWindowBalanceFromServer <= 0)
                            // this.SendWindowUpdate(stream, stream.Session.CurrentWindowBalanceToServer);
                        //stream.UpdateWindowBalance(-frame.Data.Length);
                    }
                    receivedDataBuffer.AddRange(frame.Data);
                    if (frame.IsFinal && this.OnStreamFrame != null)
                    {
                         this.OnStreamFrame(this, new StreamDataEventArgs(stream, new ProtocolData(receivedDataBuffer.ToArray()), frame.IsFinal));
                        this.receivedDataBuffer.Clear();
                    }
                }
            }
        }