protected FastCache GetShortCache() { lock ((Obj)) { if (_mcache == null) { _mcache = new FastCache(500); } } return(_mcache); }
public DnsResolver(DnsResolverSettings?setting = null) { try { if (setting == null) { setting = new DnsResolverSettings(); } this.Settings = setting; this.ReverseLookupCache = new FastCache <string, ReverseLookupCacheItem>(this.Settings.ReverseLookupIntervalCacheTimeoutMsecs, comparer: StrComparer.IpAddressStrComparer); this.ForwardLookupCache = new FastCache <string, ForwardLookupCacheItem>(this.Settings.ForwardLookupIntervalCacheTimeoutMsecs, comparer: StrComparer.IgnoreCaseComparer); } catch { this._DisposeSafe(); throw; } }