[in] A pointer to the packet data (see also
HNPacket.PacketData [Get]).
IncPacketSize
[in] Packet size (see also
HNPacket.IncPacketSize [Get/Set]).
Description:
Packets processing code in the OnPacketReceive event handler must be as fast as possible because
if the packets processing performance is low, and the network traffic is high, you run the risk of
losing some packets.
Please use statistics to make sure that your application does not lose any packets.
For example, when you use a BPF filter, and if your application is in time to process all packets,
then the value returned by AdpGetProcessCount is equal to
the AdpGetAcceptCount one.
If you do not use a filter, you should compare
AdpGetProcessCount and
AdpGetRecvCount returned values. In this way you can check,
whether your application is able to process the whole network traffic received by the Packet Sniffer
SDK internal driver from the system.
When the network traffic is very high, it would be very appropriate to create a packets processing
queue in your application, using a separate thread, and just enqueue the received packets in the
OnPacketReceive event handler, and to notify this queue about the receiving of a new packet (see
HNQueue).
Also, you should take into account that OnPacketReceive event handler is called in the context of a
thread, created by Packet Sniffer SDK library.
We strongly recommend you to do nothing related to the data displaying in this event handler. If
the traffic is high, such actions may lead to the hanging of the application and packets loss.