guanqixu.SimpleNetStatusPolling 1.2.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package guanqixu.SimpleNetStatusPolling --version 1.2.3                
NuGet\Install-Package guanqixu.SimpleNetStatusPolling -Version 1.2.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="guanqixu.SimpleNetStatusPolling" Version="1.2.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add guanqixu.SimpleNetStatusPolling --version 1.2.3                
#r "nuget: guanqixu.SimpleNetStatusPolling, 1.2.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install guanqixu.SimpleNetStatusPolling as a Cake Addin
#addin nuget:?package=guanqixu.SimpleNetStatusPolling&version=1.2.3

// Install guanqixu.SimpleNetStatusPolling as a Cake Tool
#tool nuget:?package=guanqixu.SimpleNetStatusPolling&version=1.2.3                
using SimpleNetStatusPolling;
using System;
using System.Collections.Generic;
using System.Net;

namespace SimpleNetStatusPollingDemo
{
    class Program
    {
        /// <summary>
        /// 主程序
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            List<IPEndPoint> ipes = new List<IPEndPoint>();
            for (int i = 1; i < 200; i++)
            {
                var ipe = new IPEndPoint(IPAddress.Parse($"14.215.177.{i}"), 80);
                ipes.Add(ipe);
            }

            NetStatusPollingService service = new NetStatusPollingService(ipes);
            service.PollingProgressing += Service_PollingProgressing;
            service.PollingFinished += Service_PollingFinished;
            service.PollingNotifyEvent += Service_PollingPeriodResultNotifyEvent;

            service.Start();
            string input;
            do
            {
                input = Console.ReadLine();
                if (input == "s")
                {
                    service.Start(2000, 10);
                }
                else if (input == "e")
                {
                    service.Stop();
                }
                else if (string.IsNullOrWhiteSpace(input))
                {
                    service.Stop();
                    break;
                }

            } while (input != "");
        }

        private static void Service_PollingPeriodResultNotifyEvent(Dictionary<IPEndPoint, bool> obj)
        {
            Console.WriteLine("Period! " + obj.Count);
            foreach (var item in obj)
            {
                Console.WriteLine($"{item.Key}, {item.Value}");
            }
        }

        /// <summary>
        /// 轮询完成,返回所有结果
        /// </summary>
        /// <param name="obj"></param>
        private static void Service_PollingFinished(Dictionary<IPEndPoint, bool> obj)
        {
            Console.WriteLine("Finished! " + obj.Count);
            foreach (var item in obj)
            {
                Console.WriteLine($"{item.Key}, {item.Value}");
            }
        }

        /// <summary>
        /// 单次轮询,返回每次的结果
        /// </summary>
        /// <param name="arg1"></param>
        /// <param name="arg2"></param>
        private static void Service_PollingProgressing(IPEndPoint arg1, bool arg2)
        {
            Console.WriteLine($"Processing! {arg1}, {arg2}");
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.4 559 3/16/2020
1.2.3 606 1/19/2020
1.2.2 578 1/19/2020
1.2.1 473 1/16/2020
1.0.1 533 1/13/2020
1.0.0 533 1/11/2020

1.2.3
1. 增加代码注释;
2. 提供修改满足指定数量便向外通知的接口;

--------------------
1.2.2
删除不需要的列表对象

--------------------
1.2.1
1. 删除不需要的控制台打印信息;
2. 增加轮询结果到达指定数量后,也向外进行事件通知的功能(PollingNotifyEvent)