lazebird.rabbit.ping
2.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package lazebird.rabbit.ping --version 2.0.3
NuGet\Install-Package lazebird.rabbit.ping -Version 2.0.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="lazebird.rabbit.ping" Version="2.0.3" />
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.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: lazebird.rabbit.ping, 2.0.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 lazebird.rabbit.ping as a Cake Addin
#addin nuget:?package=lazebird.rabbit.ping&version=2.0.3
// Install lazebird.rabbit.ping as a Cake Tool
#tool nuget:?package=lazebird.rabbit.ping&version=2.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ping
Description
Target
API
public rping(Action<string> log)
- Constructor
- Log: log output interface
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.
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. |
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.
support sync and async ping request, reply callback