Пример #1
0
        public SocketStore(string storeName,
                       string host,
                       int port,
                       ClientConfig config,
                       ConnectionPool connPool,
                       RequestFormatType type,
                       bool shouldReroute)
        {
            if (string.IsNullOrEmpty(storeName)) throw new ArgumentNullException("storeName", "storeName cannot be null.");
            if (string.IsNullOrEmpty(host)) throw new ArgumentNullException("host", "host cannot be null.");
            if (null == config) throw new ArgumentNullException("config", "config cannot be null.");
            if (null == connPool) throw new ArgumentNullException("connPool", "connPool cannot be null.");
            
            this.Name = storeName;
            this.Host = host;
            this.Port = port;
            this.Config = config;
            this.Pool = connPool;
            this.Type = type;
            this.ShouldReroute = shouldReroute;

            this.request = RequestFormat.newRequestFormat(type);
        }
Пример #2
0
        static ConnectionPool GetPool(ClientConfig config, Uri uri)
        {
            ConnectionPool pool = Pools[uri] as ConnectionPool;

            if (null == pool)
            {
                pool = new ConnectionPool(config);

                lock (Pools)
                {
                    Pools.Add(uri, pool);
                }
            }

            return pool;
        }
 public SocketStoreClientFactory(ClientConfig config):base(config)
 {
     _ConnPool = new ConnectionPool(this.ClientConfig);
 }