// pinger delegate callbacks private void OnStarted(object sender, SimplePingStartedEventArgs e) { statusLabel.Text = "pinging " + GetDisplayAddress(e.EndPoint); // Send the first ping straight away. pinger?.SendPing(null); }
// pinger delegate callbacks private void OnStarted(object sender, SimplePingStartedEventArgs e) { Console.WriteLine("pinging " + GetDisplayAddress(e.EndPoint)); // Send the first ping straight away. SendPing(); // And start a timer to send the subsequent pings. sendTimer = NSTimer.CreateRepeatingScheduledTimer(TimeSpan.FromSeconds(1.0), t => SendPing()); }