Packet Sniffer SDK DLL Edition

HNFileAdapter :: Properties :: FAdpSetQueue

 Previous Next

Sets the handle of HNQueue object.

Syntax:

HANDLE __stdcall FAdpSetQueue(HANDLE hFAdp, HANDLE hQue);

Parameters:

hFAdp

[in] HNFileAdapter object handle.

hQue

[in] HNQueue object handle.

Return values:

If the function succeeds the return value will be the HNQueue handle, otherwise the returned value will be NULL.

Description:

Use FAdpSetQueue to set queue for packets processing by HNFileAdapter object in AutoMode.

If HNFileAdapter.Queue property was set to not-NULL before CAP file is created/opened, and AutoMode was set (see HNFileAdapter.AutoMode [Get/Set]), then traffic will be processed with HNQueue component.

For data reading/writing in AutoMode please use FAdpOpenFile/FAdpCreateFile functions respectively.

HNFileAdapter.Queue property can be changed only when HNFileAdapter component is closed (see FAdpIsOpened).

To set packets queue for the network adapter, please do the following:

...
QueSetMaxPacketSize(hQue,1514);
QueSetItemsCount(hQue,50000);
QueAllocItems(hQue);
QueStart(hQue);

FAdpSetAutoMode(hFAdp, TRUE);
FAdpSetQueue(hFAdp,hQue);
FAdpOpenFile(hFAdp, "packets.cap");
...
QueStop(hQue);
QueFreeItems(hQue);
See also:HNFileAdapter, HNQueue, FAdpGetQueue, FAdpGetAutoMode, FAdpSetAutoMode, FAdpOpenFile, FAdpCreateFile, FAdpIsOpened