/// <summary>
/// Send SNMP version 2 Trap notification
/// </summary>
/// <param name="packet">SNMP v2 Trap packet class</param>
/// <param name="peer">Manager (receiver) IP address</param>
/// <param name="port">Manager (receiver) UDP port number</param>
public void SendV2Trap(SnmpV2Packet packet, IpAddress peer, int port)
{
if (packet.Pdu.Type != PduType.V2Trap)
{
throw new SnmpInvalidPduTypeException("Invalid Pdu type.");
}
byte[] outBuffer = packet.encode();
_sock.SendTo(outBuffer, new IPEndPoint((IPAddress)peer, port));
}