Beispiel #1
0
        public ClientPool5(string ip, int port)
        {
            _ip   = ip;
            _port = port;

            _node1 = new NewRedisClient14();
            _node1.CreateConnection(ip, port);

            _node2 = new NewRedisClient14();
            _node2.CreateConnection(ip, port);

            _node3 = new NewRedisClient14();
            _node3.CreateConnection(ip, port);
        }
Beispiel #2
0
        private static void Configuration()
        {
            _useDelay   = true;
            _delayCount = 15000;
            //Notice : Please use "//" comment "/*".

            ///*
            using (StreamReader stream = new StreamReader("Redis.rsf"))
            {
                ip   = stream.ReadLine();
                port = int.Parse(stream.ReadLine());
                pwd  = stream.ReadLine();
            }//*/

            /*
             * ip = "127.0.0.1";
             * port = 6379;
             * //*/

            // NewLife.Redis
            // _newLifeRedis = new NewLife.Caching.Redis($"{ip}:{port}",null, 1);
            //var result = newLifeRedis.Set("1", "1");
            //Console.WriteLine(result);
            //Console.ReadKey();
            //_beetleClient = new BeetleX.Redis.RedisDB(0);
            //var host = _beetleClient.Host.AddWriteHost(ip, port);
            //host.MaxConnections = 1000;
            //host.QueueMaxLength = 512;
            //_freeRedisClient = new RedisClient($"{ip}:{port},database=0,min pool size=100");
            //_redisClient0 = new NewRedisClient0(ip, port);

            //_pool4 = new ClientPool1<NewRedisClient4>(ip, port);
            //_pool5 = new ClientPool1<NewRedisClient5>(ip, port);
            //_pool7 = new ClientPool1<NewRedisClient7>(ip, port);
            //_pool9 = new ClientPool1<NewRedisClient9>(ip, port);
            //_pool27 = new ClientPool2<NewRedisClient7>(ip, port);
            //_pool25 = new ClientPool2<NewRedisClient5>(ip, port);
            //_pool24 = new ClientPool2<NewRedisClient4>(ip, port);
            //_redisClient1 = new NewRedisClient1(ip, port);
            //_redisClient2 = new NewRedisClient2(ip, port);
            //_redisClient3 = new NewRedisClient3(ip, port);
            //_redisClient12 = new NewRedisClient12();
            //_redisClient12.CreateConnection(ip, port);
            _redisClient14 = new NewRedisClient14();
            _redisClient14.CreateConnection(ip, port);
            _redisClient14.AuthAsync(pwd);
            _redisClient4 = new NewRedisClient4();
            _redisClient4.CreateConnection(ip, port);
            _redisClient4.AuthAsync(pwd);
            //_redisClient4.AuthAsync(pwd);
            //_redisClient5 = _pool5._node;
            //_redisClient7 = _pool7._node;
            //_redisClient8 = new NewRedisClient8();
            //_redisClient8.CreateConnection(ip, port);
            _redisClient9 = new NewRedisClient9();
            _redisClient9.CreateConnection(ip, port);
            _redisClient9.AuthAsync(pwd);
            ///_pool13 = new ClientPool4(ip, port);
            //_pool13.AuthAsync(pwd);
            _pool10 = new ClientPool3(ip, port);
            _pool10.AuthAsync(pwd);
            _pool14 = new ClientPool5(ip, port);
            _pool14.AuthAsync(pwd);
            //_redisClient5.SetAsync("a", "a");
            seredis = ConnectionMultiplexer.Connect($"{ip}:{port},password={pwd}");
            _stackExnchangeClient = seredis.GetDatabase(0);


            //_beforeSw = (str) =>
            //{
            //    if (str.Contains("Pool10"))
            //    {
            //        _pool10.Start();
            //    }
            //};
        }