Packet Sniffer SDK DLL Edition

HNAdapter :: Properties :: AdpSetReceiveQueue

 Previous Next

Sets the handle of HNQueue object.

Syntax:

HANDLE __stdcall AdpSetReceiveQueue(HANDLE hAdp, HANDLE hQue);

Parameters:

hAdp

[in] HNAdapter 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 AdpSetReceiveQueue to set the received packets queue.

If ReceiveQueue property was not set to NULL before the opening of the network adapter, then traffic processing will be executed by HNQueue component, otherwise a standard OnPacketReceive event handler will be called.

ReceiveQueue property can be changed only when HNAdapter component is closed (see AdpIsOpened).

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

...
QueSetMaxPacketSize(hQue,1514);
QueSetItemsCount(hQue,50000);
QueAllocItems(hQue);
AdpSetReceiveQueue(hAdp,hQue);
...
AdpOpenAdapter(hAdp);
...
AdpCloseAdapter(hAdp);
...
QueFreeItems(hQue);
See also:HNAdapter, HNQueue, OnPacketReceive, AdpGetReceiveQueue