From 64ba5665f7a9b99ab8dae64aedc53f568500dc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E9=99=90=E9=A3=8E=E7=81=B5?= <827937686@qq.com> Date: Wed, 15 May 2019 11:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2ip=20=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 索引超出范围。必须为非负值并小于集合大小。 参数名: index --- FastDFS/Common/ConnectionManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FastDFS/Common/ConnectionManager.cs b/FastDFS/Common/ConnectionManager.cs index 7602c81..8f50a83 100644 --- a/FastDFS/Common/ConnectionManager.cs +++ b/FastDFS/Common/ConnectionManager.cs @@ -129,7 +129,8 @@ public static bool Initialize(List trackers) public static Connection GetTrackerConnection() { Random random = new Random(); - int index = random.Next(trackerPools.Count); + //int index = random.Next(trackerPools.Count); + int index = random.Next(listTrackers.Count); //Pool中的数据个数大于Trackers的 Pool pool = trackerPools[listTrackers[index]]; return pool.GetConnection(); }