예제 #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
        public async Task<HttpStream> CreateStream ()
        {
            await lockStreams.WaitAsync ();

            var stream = new HttpStream ();

            Streams.Add (stream.StreamIdentifer, stream);

            lockStreams.Release ();

            return stream;
        }
예제 #4
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;
        }