public IdleTimeoutIdleConnectionPool(IdlingCommunicationPool <TKey, TItem> .IdleTimeoutEndpointConnectionPool parent, object thisLock) : base(parent.Parent.MaxIdleConnectionPoolCount) { this.parent = parent; IdlingCommunicationPool <TKey, TItem> idlingCommunicationPool = (IdlingCommunicationPool <TKey, TItem>)parent.Parent; this.idleTimeout = idlingCommunicationPool.idleTimeout; this.leaseTimeout = idlingCommunicationPool.leaseTimeout; this.thisLock = thisLock; this.connectionMapping = new Dictionary <TItem, IdlingCommunicationPool <TKey, TItem> .IdleTimeoutEndpointConnectionPool.IdleTimeoutIdleConnectionPool.IdlingConnectionSettings>(); }
public IdleTimeoutEndpointConnectionPool(IdlingCommunicationPool <TKey, TItem> parent, TKey key) : base(parent, key) { this.connections = new IdlingCommunicationPool <TKey, TItem> .IdleTimeoutEndpointConnectionPool.IdleTimeoutIdleConnectionPool(this, base.ThisLock); }
private bool IdleOutConnection(TItem connection, DateTime now) { if (connection == null) { return(false); } bool flag = false; IdlingCommunicationPool <TKey, TItem> .IdleTimeoutEndpointConnectionPool.IdleTimeoutIdleConnectionPool.IdlingConnectionSettings item = this.connectionMapping[connection]; if (now > (item.LastUsage + this.idleTimeout)) { this.TraceConnectionIdleTimeoutExpired(); flag = true; } else if ((now - item.CreationTime) >= this.leaseTimeout) { this.TraceConnectionLeaseTimeoutExpired(); flag = true; } return(flag); }