Packet Sniffer SDK VCL Edition

HNAdapter :: Methods :: Get_AsyncStatistics

 Previous Next

Updates network adapter statistics synchronously.

Syntax:

function Get_AsyncStatistics(StatisticsType: Integer): DWORD;

Parameters:

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 OpenAdapter.
HNERR_ADAPTER_REQ_ERRAn internal driver request error.

Description:

After the network adapter has been opened successfully by OpenAdapter method, you can use Get_AsyncStatistics method to update network adapter statistics which type is defined by StatisticsType parameter.

Unlike UpdateUserStatistics and UpdateAdapterStatistics methods, on Get_AsyncStatistics method 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 Get_xxxCount methods after OnStatistics event handler has been executed.

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

See also:Packets processing diagram, HNAdapter, OpenAdapter, UpdateUserStatistics, UpdateAdapterStatistics, OnStatistics