Walter.Net.HoneyPot
PingReceivedEventArgs Class
Members  Example 
Walter.Net.HoneyPot Assembly > Walter.Net.HoneyPot.EventArguments Namespace : PingReceivedEventArgs Class
Object Model
PingReceivedEventArgs ClassPingsReceived Structure
Syntax
public sealed class PingReceivedEventArgs : System.EventArgs 
Example
The following example demonstrates how to subscribe to the OnPingReceived event and handle it using PingReceivedEventArgs.
public class PingReceiver
{
    private readonly IPortScannerDetectionService _portScannerDetectionService;
            
    public PingReceiver(IPortScannerDetectionService portScannerDetectionService)
    {
        _portScannerDetectionService = portScannerDetectionService;
        _portScannerDetectionService.OnPingReceived += HandlePingReceived;
    }
            
    private void HandlePingReceived(object sender, PingReceivedEventArgs e)
    {
        Console.WriteLine($"Last ping received at: {e.LastPing.ReceivedUtc}");
        Console.WriteLine($"Data from last ping: {BitConverter.ToString(e.LastData)}");
            
        foreach (var receivedTime in e.PingsReceived)
        {
            Console.WriteLine($"Previous ping received at: {receivedTime}");
        }
    }
}
Inheritance Hierarchy

System.Object
   System.EventArgs
      Walter.Net.HoneyPot.EventArguments.PingReceivedEventArgs

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PingReceivedEventArgs Members
Walter.Net.HoneyPot.EventArguments Namespace