Skip to content

Commit 7fdf4e8

Browse files
committed
.
1 parent 830299c commit 7fdf4e8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

fast cf ip scanner/Services/IPService.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public IPService(FastCFIPScannerDatabase db)
1616
_db = db;
1717
}
1818
#region Test Ips
19-
public async Task<List<IPModel>> GetIpValid(string[] ips, IpOptionModel ipOptions, string protcol)
19+
public async Task<List<IPModel>> GetIpValid(string[] ips, IpOptionModel ipOptions, string protocol)
2020
{
2121
var validIps = new List<IPModel>();
22-
switch (protcol)
22+
switch (protocol)
2323
{
2424
case "Http test (recommended)":
2525
validIps = await GetValidIPWithHttpTest(ips, ipOptions);
@@ -137,7 +137,7 @@ async Task TestConnectionAsync(string ip)
137137
{
138138
var ports = new List<string>();
139139
var stopwatch = new Stopwatch();
140-
var totolTimeOut = 0;
140+
var totalTimeOut = 0;
141141
var totalPing = 0;
142142
for (int i = 0; i < ipOptions.CountOfRepeatTestForEachIp; i++)
143143
{
@@ -163,13 +163,13 @@ async Task TestConnectionAsync(string ip)
163163
}
164164
else
165165
{
166-
totolTimeOut++;
166+
totalTimeOut++;
167167
}
168168
}
169169
}
170170
catch
171171
{
172-
totolTimeOut++;
172+
totalTimeOut++;
173173
}
174174
}
175175
}
@@ -183,7 +183,7 @@ async Task TestConnectionAsync(string ip)
183183
IP = ip,
184184
Ping = ping,
185185
Ports = string.Join(",", ports),
186-
CountOfTimeout = totolTimeOut
186+
CountOfTimeout = totalTimeOut
187187
});
188188
}
189189
}
@@ -214,7 +214,7 @@ public async Task<List<IPModel>> GetValidIPWithUDPTest(string[] ips, int maxPing
214214
{
215215
var validIp = new ConcurrentBag<IPModel>();
216216
var randips = GetRandomIp(ips);
217-
foreach (var ipAddresse in randips)
217+
foreach (var ipAddress in randips)
218218
{
219219
var t = new Task(() =>
220220
{
@@ -224,7 +224,7 @@ public async Task<List<IPModel>> GetValidIPWithUDPTest(string[] ips, int maxPing
224224
var client = new UdpClient();
225225

226226
stopwatch.Start();
227-
client.Connect(ipAddresse, 443);
227+
client.Connect(ipAddress, 443);
228228
stopwatch.Stop();
229229

230230
var ping = Convert.ToInt32(stopwatch.Elapsed.TotalMilliseconds);
@@ -233,7 +233,7 @@ public async Task<List<IPModel>> GetValidIPWithUDPTest(string[] ips, int maxPing
233233
{
234234
validIp.Add(new IPModel
235235
{
236-
IP = ipAddresse.ToString(),
236+
IP = ipAddress.ToString(),
237237
Ping = ping,
238238
});
239239
}
@@ -370,11 +370,11 @@ public List<string> GetRandomIp(string[] ips, int ipCount = 20, int ipRangeCount
370370
}
371371
var randomIps = new List<string>();
372372
var countOfEachRange = ipCount / ipRangeCount;
373-
foreach (var iprange in randomIpRange)
373+
foreach (var ipRange in randomIpRange)
374374
{
375375
for (int i = 1; i < countOfEachRange; i++)
376376
{
377-
randomIps.Add(iprange + random.Next(255));
377+
randomIps.Add(ipRange + random.Next(255));
378378
}
379379
}
380380
return randomIps;

0 commit comments

Comments
 (0)