Exemplo n.º 1
0
 internal SocketPool(ServerPool owner, string host)
 {
     Host       = host;
     this.owner = owner;
     endPoint   = getEndPoint(host);
     queue      = new Queue <PooledSocket>();
 }
        //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);
        }
Exemplo n.º 3
0
        //Private constructor
        private MemcachedClient(string name, string[] hosts)
        {
            if (String.IsNullOrEmpty(name))
            {
                Error.Throw("Name of MemcachedClient instance cannot be empty.");
            }
            if (hosts == null || hosts.Length == 0)
            {
                Error.Throw("Cannot configure MemcachedClient with empty list of hosts.");
            }

            Name       = name;
            serverPool = new ServerPool(hosts, CacheType.MemCache);
        }
Exemplo n.º 4
0
        //Private constructor
        private RedisClient(string name, string[] hosts)
        {
            if (String.IsNullOrEmpty(name))
            {
                Error.Throw("Name of RedisClient instance cannot be empty.");
            }
            if (hosts == null || hosts.Length == 0)
            {
                Error.Throw("Cannot configure RedisClient with empty list of hosts.");
            }

            Name                    = name;
            serverPool              = new ServerPool(hosts, CacheType.Redis);
            serverPool.OnAuthEvent += new ServerPool.AuthDelegate(serverPool_OnAuthEvent);
        }