public async Task <HttpStream> CreateStream() { await lockStreams.WaitAsync(); var stream = new HttpStream(); Streams.Add(stream.StreamIdentifer, stream); lockStreams.Release(); return(stream); }
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); }
public async Task<HttpStream> CreateStream () { await lockStreams.WaitAsync (); var stream = new HttpStream (); Streams.Add (stream.StreamIdentifer, stream); lockStreams.Release (); return stream; }
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; }