lazebird.rabbit.ping 2.0.2

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.2
NuGet\Install-Package lazebird.rabbit.ping -Version 2.0.2
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.2" />
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.2
#r "nuget: lazebird.rabbit.ping, 2.0.2"
#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.2

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

ping

Description

Target

API

  1. public rping(Action<string> log)
    Constructor Log: log output interface

  2. public void start(string addr, int timeout, Action<int, PingReply> callback)
    Synchronous ping operation Addr: ping address Timeout: ping timeout in milliseconds Callback: the callback function that handles the result. The first parameter is the request id, which is used to match the request and response. The second parameter is the ping result object.

  3. public int start_async(string addr, int timeout, Action<int, PingReply> callback)
    Asynchronous ping operation Addr: ping address Timeout: ping timeout in milliseconds Callback: the callback function that handles the result. The first parameter is the request id, which is used to match the request and response. The second parameter is the ping result object.

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 669 6/27/2019
2.1.1 781 9/11/2018
2.1.0 791 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