private Http2Stream GetImpl(StreamGetCallback cb)
        {
            lockStreams.WaitOne();

            var stream = new Http2Stream(flowControlManager, GetNextIdentifier());

            streams.Add(stream.StreamIdentifer, stream);

            lockStreams.Release();

            cb?.Invoke(stream);
            return(stream);
        }
        private Http2Stream GetWithIdentifier(uint streamIdentifier, StreamGetCallback cb)
        {
            lockStreams.WaitOne();

            Http2Stream stream = null;

            if (!streams.ContainsKey(streamIdentifier))
            {
                stream = new Http2Stream(flowControlManager, streamIdentifier);
                streams.Add(streamIdentifier, stream);
            }
            else
            {
                stream = streams[streamIdentifier];
            }

            lockStreams.Release();

            cb?.Invoke(stream);
            return(stream);
        }