lazebird.rabbit.ping
2.0.1
See the version list below for details.
dotnet add package lazebird.rabbit.ping --version 2.0.1
NuGet\Install-Package lazebird.rabbit.ping -Version 2.0.1
<PackageReference Include="lazebird.rabbit.ping" Version="2.0.1" />
paket add lazebird.rabbit.ping --version 2.0.1
#r "nuget: lazebird.rabbit.ping, 2.0.1"
// Install lazebird.rabbit.ping as a Cake Addin #addin nuget:?package=lazebird.rabbit.ping&version=2.0.1 // Install lazebird.rabbit.ping as a Cake Tool #tool nuget:?package=lazebird.rabbit.ping&version=2.0.1
ping
Description
Target
API
public rping(Action<string> log)
Constructor Log: log output interfacepublic 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.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 | Versions 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. |
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.
support sync and async ping request, reply callback