示例#1
0
        private async static void Configuration()
        {
            _options = new ParallelOptions();
            _options.MaxDegreeOfParallelism = 4;
            _useDelay   = true;
            _delayCount = 8000;
            //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");


            _redisClient161 = new NewRedisClient161();
            _redisClient161.CreateConnection(ip, port);
            //_redisClient161.AuthAsync(pwd);

            _redisClient162 = new NewRedisClient162();
            _redisClient162.CreateConnection(ip, port);
            //_redisClient162.AuthAsync(pwd);

            _redisClient21 = new NewRedisClient21();
            _redisClient21.CreateConnection(ip, port);
            _redisClient21.AuthAsync(pwd);



            _redisClient22 = new NewRedisClient22();
            _redisClient22.CreateConnection(ip, port);
            _redisClient22.AuthAsync(pwd);

            //var result = await _redisClient22.SetAsync("1","1");
            //Console.WriteLine(result);
            //result = await _redisClient22.SetAsync("1", "1");
            //Console.WriteLine(result);

            _redisClient23 = new NewRedisClient23();
            _redisClient23.CreateConnection(ip, port);
            _redisClient23.AuthAsync(pwd);

            _redisClient24 = new NewRedisClient24();
            _redisClient24.CreateConnection(ip, port);
            _redisClient24.AuthAsync(pwd);

            _redisClient4 = new NewRedisClient4();
            _redisClient4.CreateConnection(ip, port);
            _redisClient4.AuthAsync(pwd);

            seredis = ConnectionMultiplexer.Connect($"{ip}:{port},password={pwd}");
            _stackExnchangeClient = seredis.GetDatabase(0);
            //T();
            //Console.ReadKey();
        }
示例#2
0
 public NewRedisClient24()
 {
     _taskBuffer    = new CircleTaskBuffer2 <bool>();
     _protocalStart = (byte)43;
     _other         = new NewRedisClient22();
 }