コード例 #1
0
        public async Task <HttpStream> CreateStream()
        {
            await lockStreams.WaitAsync();

            var stream = new HttpStream();

            Streams.Add(stream.StreamIdentifer, stream);

            lockStreams.Release();

            return(stream);
        }
コード例 #2
0
        public async Task <HttpStream> GetStream(uint streamIdentifier)
        {
            await lockStreams.WaitAsync();

            HttpStream stream = null;

            if (!Streams.ContainsKey(streamIdentifier))
            {
                stream = new HttpStream(streamIdentifier);
                Streams.Add(streamIdentifier, stream);
            }
            else
            {
                stream = Streams [streamIdentifier];
            }

            lockStreams.Release();

            return(stream);
        }
コード例 #3
0
ファイル: Http2Connection.cs プロジェクト: Garciat/HttpTwo
        public async Task<HttpStream> CreateStream ()
        {
            await lockStreams.WaitAsync ();

            var stream = new HttpStream ();

            Streams.Add (stream.StreamIdentifer, stream);

            lockStreams.Release ();

            return stream;
        }
コード例 #4
0
ファイル: Http2Connection.cs プロジェクト: Garciat/HttpTwo
        public async Task<HttpStream> GetStream (uint streamIdentifier)
        {
            await lockStreams.WaitAsync ();

            HttpStream stream = null;

            if (!Streams.ContainsKey (streamIdentifier)) {
                stream = new HttpStream (streamIdentifier);
                Streams.Add (streamIdentifier, stream);
            } else {
                stream = Streams [streamIdentifier];
            }

            lockStreams.Release ();

            return stream;
        }