Packet Sniffer SDK DLL Edition

Events :: OnTcpPacketReceive

 Previous Next

Fires when an application receives or sends TCP data.

Syntax:

void __stdcall OnTcpPacketReceive(DWORD_PTR Param, DWORD_PTR ThParam, HANDLE hLBSession, DWORD Direction, 
                                  DWORD Pid, HANDLE hPacket, LPVOID pData, DWORD DataLength);

Parameters:

Param

[in] OnTcpPacketReceive event handler parameter. May be set by the LbAdpSetOnTcpPacketRecv function call.

ThParam

[in] User defined thread parameter (see HNFN_THREADBEGIN).

hLBSession

[in] HNLBSession object handle to which the packet belongs to.

Direction

[in] The direction of the operation (values are defined by HNLBDirection enumeration).

Pid

[in] PID of the process, which has sent or received this packet.

hPacket

[in] HNPacket object handle.

pData

[in] A pointer to the packet data (see HNPacket.PacketData [Get]).

DataLength

[in] Packet size (see also HNPacket.IncPacketSize [Get/Set]).

Description:

Use this event handler to make necessary actions at the moment of sending or receiving TCP data by an application. OnTcpPacketReceive event handler is called by HNLBAdapter component when an application sends or receives data (e.g. using Send or WSASend sockets functions).

See also:HNLBAdapter, LbAdpSetOnTcpPacketRecv, HNFN_THREADBEGIN, HNLBSession, HNLBDirection, HNPacket, PktGetPacketData, PktGetIncPacketSize, PktSetIncPacketSize