Example #1
0
 protected FastCache GetShortCache()
 {
     lock ((Obj))
     {
         if (_mcache == null)
         {
             _mcache = new FastCache(500);
         }
     }
     return(_mcache);
 }
Example #2
0
    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;
        }
    }