Packet Sniffer SDK DLL Edition

Events :: OnSessionCreate

 Previous Next

Fires on the new TCP session is registered by HNTcpManager object.

Syntax:

void __stdcall OnSessionCreate(DWORD_PTR Param, HANDLE hTcpSession, BOOL *pbNeed);

Parameters:

Param

[in] OnSessionCreate event handler parameter. May be set by the TcpMgrSetOnCreate function call.

hTcpSes

[in] HNTcpSession object handle.

pbNeed

[in,out] Flag that prevents HNTcpSession object deleting. If this flag is set to FALSE during OnSessionCreate executing, then HNTcpManager object stops the tracking of this session (deletes HNTcpSession object immediately after OnSessionCreate event handler is executed. The default value of this flag is TRUE.

Description:

Set this event handler to make necessary actions at the moment of the new TCP session is registered. OnSessionConnect event handler is executed in the context of a thread, which has called TcpMgrProcessPacket function.

While OnSessionCreate event handler is executing, you may set HNTcpSession.UserData [Get/Set] property (e.g. store in it the address of your own structure, describing this TCP connection) to get access to this data on other HNTcpManager events fire later.
See also:HNTcpManager, TcpMgrSetOnCreate, HNTcpSession, TcpMgrProcessPacket, TcpSesGetUserData, TcpSesSetUserData