/// <summary> /// Stores a given association for later recall. /// </summary> /// <param name="distinguishingFactor">The distinguishing factor, either an OP Endpoint or smart/dumb mode.</param> /// <param name="association">The association to store.</param> public void StoreAssociation(TKey distinguishingFactor, Association association) { lock (this) { if (!this.serverAssocsTable.ContainsKey(distinguishingFactor)) { this.serverAssocsTable.Add(distinguishingFactor, new Associations()); } Associations server_assocs = this.serverAssocsTable[distinguishingFactor]; server_assocs.Set(association); } }
/// <summary> /// Stores a given association for later recall. /// </summary> /// <param name="distinguishingFactor">The distinguishing factor, either an OP Endpoint or smart/dumb mode.</param> /// <param name="association">The association to store.</param> public void StoreAssociation(TKey distinguishingFactor, Association association) { lock (this) { if (!this.serverAssocsTable.ContainsKey(distinguishingFactor)) { this.serverAssocsTable.Add(distinguishingFactor, new Associations()); } Associations server_assocs = this.serverAssocsTable[distinguishingFactor]; server_assocs.Set(association); unchecked { this.periodicCleaning++; } if (this.periodicCleaning % PeriodicCleaningFrequency == 0) { this.ClearExpiredAssociations(); } } }