lazebird.rabbit.ping 3.0.0

an stupid ping library.

Install-Package lazebird.rabbit.ping -Version 3.0.0
dotnet add package lazebird.rabbit.ping --version 3.0.0
<PackageReference Include="lazebird.rabbit.ping" Version="3.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 3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ping

Description

Target

API

  1. public rping(Action<string> log)

    • Constructor
    • log: log output interface
  2. public void start(string addr, Hashtable opts, Action<PingReply, object> callback, object data)

    • ping session start
    • addr: ping destination address
    • opts:
      • interval: ping interval, also used to be timeout,default 1000ms
      • count: ping send count, default -1, means infinit
      • stoponloss: stop ping if there is a pkt loss
    • callback: a callback function, which will be called for all ping replies; when ping stopped, callback called with PingReply=null
    • data: argument for callback
  3. public void stop()

    • ping session stop
  4. public override string ToString()

    • ping session tostring
    • return realtime session statistics as a string

Sample

```
void ping_cb(PingReply reply, object data)
{
    if (reply == null)
    {
        ((Form)formhash["form"]).Text = "Rabbit";
        ((Button)btnhash["ping_btn"]).Text = Language.trans("开始");
    }
    else display_taskbar(reply.Status == IPStatus.Success);
    text_pingstat.Text = ping.ToString();
}
rping ping = new rping(ping_log_func);
Hashtable ping_opts = ropt.parse_opts(text_pingopt.Text);
ping.start(ping_addr, ping_opts, ping_cb, null);
```

ping

Description

Target

API

  1. public rping(Action<string> log)

    • Constructor
    • log: log output interface
  2. public void start(string addr, Hashtable opts, Action<PingReply, object> callback, object data)

    • ping session start
    • addr: ping destination address
    • opts:
      • interval: ping interval, also used to be timeout,default 1000ms
      • count: ping send count, default -1, means infinit
      • stoponloss: stop ping if there is a pkt loss
    • callback: a callback function, which will be called for all ping replies; when ping stopped, callback called with PingReply=null
    • data: argument for callback
  3. public void stop()

    • ping session stop
  4. public override string ToString()

    • ping session tostring
    • return realtime session statistics as a string

Sample

```
void ping_cb(PingReply reply, object data)
{
    if (reply == null)
    {
        ((Form)formhash["form"]).Text = "Rabbit";
        ((Button)btnhash["ping_btn"]).Text = Language.trans("开始");
    }
    else display_taskbar(reply.Status == IPStatus.Success);
    text_pingstat.Text = ping.ToString();
}
rping ping = new rping(ping_log_func);
Hashtable ping_opts = ropt.parse_opts(text_pingopt.Text);
ping.start(ping_addr, ping_opts, ping_cb, null);
```

Release Notes

support sync and async ping request, reply callback

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.0.0 68 6/27/2019
2.1.1 185 9/11/2018
2.1.0 171 8/15/2018
2.0.9 174 7/31/2018
2.0.6 171 7/27/2018
2.0.5 182 7/26/2018
2.0.3 158 7/23/2018
2.0.2 237 7/3/2018
2.0.1 238 7/3/2018
2.0.0 213 7/2/2018
1.0.0 214 6/28/2018