lazebird.rabbit.ping 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package lazebird.rabbit.ping --version 2.0.0
NuGet\Install-Package lazebird.rabbit.ping -Version 2.0.0
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="lazebird.rabbit.ping" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add lazebird.rabbit.ping --version 2.0.0
#r "nuget: lazebird.rabbit.ping, 2.0.0"
#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 lazebird.rabbit.ping as a Cake Addin
#addin nuget:?package=lazebird.rabbit.ping&version=2.0.0

// Install lazebird.rabbit.ping as a Cake Tool
#tool nuget:?package=lazebird.rabbit.ping&version=2.0.0

ping

Description

Target

API

  1. public rping(Action<string> log) 构造函数 log:log输出接口

  2. public void start(string addr, int timeout, Action<int, PingReply> callback) 同步执行ping操作 addr:ping地址 timeout: ping超时时间,单位毫秒 callback:处理结果的回调函数,第一个参数为请求id,用于匹配请求和响应;第二个参数为ping结果对象

  3. public int start_async(string addr, int timeout, Action<int, PingReply> callback) 异步执行ping操作 addr:ping地址 timeout: ping超时时间,单位毫秒 callback:处理结果的回调函数,第一个参数为请求id,用于匹配请求和响应;第二个参数为ping结果对象

Sample

rping ping = new rping(ping_log_func);
void ping_log_func(string msg)
{
    console.write(msg);
}
void ping_cb(int id, PingReply reply)
{
    if (reply == null)  // exception
    {
    }
    else if (reply.Status == IPStatus.Success)
    {
        pinglog.write("来自 " + reply.Address + " 的回复: 字节=" + reply.Buffer.Length + " 毫秒=" + reply.RoundtripTime + " TTL=" + reply.Options.Ttl);
    }
    else
    {
        pinglog.write("请求超时。");
    }
}
ping.start(addr, timeout, ping_cb);

void scan_reply(int id, PingReply reply)
{
    if (reply == null || reply.Status != IPStatus.Success)
    {
        ((Label)lbhash[id]).BackColor = Color.Red;
    }
}
int id = ping.start_async(addr, timeout, scan_reply);
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  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
3.0.0 674 6/27/2019
2.1.1 782 9/11/2018
2.1.0 792 8/15/2018
2.0.9 796 7/31/2018
2.0.6 791 7/27/2018
2.0.5 819 7/26/2018
2.0.3 794 7/23/2018
2.0.2 923 7/3/2018
2.0.1 939 7/3/2018
2.0.0 844 7/2/2018
1.0.0 912 6/28/2018

support sync and async ping request, reply callback