コード例 #1
0
        // 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);
        }
コード例 #2
0
        // 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());
        }