2881099 / csredis

.NET Core or .NET Framework 4.0+ client for Redis and Redis Sentinel (2.8) and Cluster. Includes both synchronous and asynchronous clients.
MIT License
2.01k stars 414 forks source link

IPv6带端口 哨兵模式 报错 #482

Open mxzhu opened 1 year ago

mxzhu commented 1 year ago

rt,设置IPv6带端口 哨兵模式 报错 var csRedis1 = new CSRedis.CSRedisClient( connectionString: cacheConfig.Redis.ConnectionString, sentinels:new[] { "[fe80::5423:f83d:e19e:97fd%5]:26379", "[fe80::5423:f83d:e19e:98fd%5]:26379", "[fe80::5423:f83d:e19e:99fd%5]:26379" }); 具体是源码里面这里 public RedisSentinelManager(bool readOnly, params string[] sentinels) { _readOnly = readOnly; _sentinels = new LinkedList<Tuple<string, int>>(); foreach (string text in sentinels) { string[] array = text.Split(new char[1] { ':' }); string host = array[0].Trim(); //报错 System.FormatException:“Input string was not in a correct format." int port = int.Parse(array[1]); Add(host, port); } }

2881099 commented 1 year ago

建议切换到 FreeRedis,发布已经3年