示例#1
0
        public bool TryAdvance(int bytes)
        {
            lock (_flowLock) {
                // Even if the stream is aborted, the client should never send more data than was available in the
                // flow-control window at the time of the abort.
                if (bytes > _flow.Available)
                {
                    throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorFlowControlWindowExceeded, Http2ErrorCode.FLOW_CONTROL_ERROR);
                }

                if (_flow.IsAborted)
                {
                    // This data won't be read by the app, so tell the caller to count the data as already consumed.
                    return(false);
                }

                _flow.Advance(bytes);
                return(true);
            }
        }
示例#2
0
 public void Advance(int bytes)
 {
     _flow.Advance(bytes);
 }