RemObjects.InternetPack.ConnectionQueue.Dequeue C# (CSharp) Метод

Dequeue() публичный Метод

public Dequeue ( ) : Connection
Результат Connection
		public Connection Dequeue()
		{
			if (this.fCount == 0)
				throw new ArgumentOutOfRangeException();

			Connection lConnection = this.fArray[this.fHead];
			this.fArray[this.fHead] = null;
			this.fCount--;
			this.fHead = (this.fHead + 1) % this.fCapacity;

			return lConnection;
		}
	}

Usage Example

Пример #1
0
        public virtual Connection GetConnection(EndPoint endPoint)
        {
            String lHost = endPoint.ToString();

            lock (this.fCache)
            {
                ConnectionQueue lQueue = this.fCache.ContainsKey(lHost) ? (ConnectionQueue)this.fCache[lHost] : null;
                if (lQueue != null && lQueue.Count > 0)
                {
                    return(lQueue.Dequeue());
                }
            }

            return(this.GetNewConnection(endPoint));
        }