Ejemplo n.º 1
0
        public void DisposeStream(IOwinStream stream)
        {
            lock (readLock)
            {
                for (var i = 0; i < owinStreams.Length; i++)
                {
                    var readClient = owinStreams[i];
                    if (stream != readClient)
                    {
                        continue;
                    }
                    stream.Active = false;
                    Monitor.PulseAll(owinStreams);
                    return;
                }
            }

            if (stream.IsDisposed)
            {
                return;
            }

            throw new NotSupportedException("Cannot add unknown IOwinStream back to the pool");
        }
		public void DisposeStream(IOwinStream stream)
		{
			lock (readLock)
			{
				for (var i = 0; i < owinStreams.Length; i++)
				{
					var readClient = owinStreams[i];
					if (stream != readClient) continue;
					stream.Active = false;
					Monitor.PulseAll(owinStreams);
					return;
				}
			}

			if (stream.IsDisposed) return;

			throw new NotSupportedException("Cannot add unknown IOwinStream back to the pool");
		}