コード例 #1
0
 internal SocketPool(ServerPool owner, string host)
 {
     Host       = host;
     this.owner = owner;
     endPoint   = getEndPoint(host);
     queue      = new Queue <PooledSocket>();
 }
コード例 #2
0
ファイル: MemcachedClient.cs プロジェクト: yaobos/NCache
        //Private constructor
        private MemcachedClient(string name, string[] hosts)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ConfigurationErrorsException("Name of MemcachedClient instance cannot be empty.");
            }
            Name       = name;
            serverPool = new ServerPool(hosts);
            string cacheName = "";

            try
            {
                cacheName = ConfigurationManager.AppSettings["NCache.CacheName"];
                if (String.IsNullOrEmpty(cacheName))
                {
                    Exception ex = new Exception("Unable to read NCache Name from configuration");
                    throw ex;
                }
            }
            catch (Exception e)
            { throw e; }

            try
            {
                memcachedProvider = CacheFactory.CreateCacheProvider(cacheName);
            }
            catch (Exception e)
            { }
        }
コード例 #3
0
ファイル: MemcachedClient.cs プロジェクト: qcjxberin/LebiShop
        //Private constructor
        private MemcachedClient(string name, string[] hosts)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ConfigurationErrorsException("Name of MemcachedClient instance cannot be empty.");
            }
            if (hosts == null || hosts.Length == 0)
            {
                throw new ConfigurationErrorsException("Cannot configure MemcachedClient with empty list of hosts.");
            }

            Name       = name;
            serverPool = new ServerPool(hosts);
        }