Packet Sniffer SDK DLL Edition

HNAdapter :: Methods :: AdpGetAsyncStatistics

 Previous Next

Updates network adapter statistics synchronously.

Syntax:

DWORD __stdcall AdpGetAsyncStatistics(HANDLE hAdp, DWORD StatisticsType);

Parameters:

hAdp

[in] HNAdapter object handle.

StatisticsType

[in] The type of the statistics requested. Must be defined by HNStatisticsType enumeration.

Return values:

HNERR_OKAdapter statistics has been updated successfully.
HNERR_ADAPTER_NOT_OPENEDNetwork adapter has not been opened, see AdpOpenAdapter.
HNERR_ADAPTER_REQ_ERRAn internal driver request error.
HNERR_INVALID_HANDLEhAdp parameter is not the HNAdapter object handle.

Description:

After the network adapter has been opened successfully by AdpOpenAdapter function, you can use AdpGetAsyncStatistics function to update network adapter statistics which type is defined by StatisticsType parameter.

Unlike AdpUpdateUserStatistics and AdpUpdateAdapterStatistics functions, on AdpGetAsyncStatistics function call, requested statistics value is returned to the OnStatistics event handler asynchronously by the thread created inside Packet Sniffer SDK.

The updated value can be also obtained by AdpGetxxxCount functions after OnStatistics event handler has been executed.

AdpGetAsyncStatistics may be useful if you want to update only one statistics value.

See also:Packets processing diagram, HNAdapter, AdpOpenAdapter, AdpUpdateUserStatistics, AdpUpdateAdapterStatistics, OnStatistics