Packet Sniffer SDK VCL Edition

HNAdapter :: Methods :: CloseAdapter

 Previous Next

Closes the network adapter.

Syntax:

function CloseAdapter: DWORD;

Return values:

HNERR_OKNetwork adapter has been closed successfully.

Description:

Use the CloseAdapter method to close the network adapter opened by OpenAdapter.

CloseAdapter method frees the OS resources, provided for the opened network adapter and stops the corresponding thread inside the HNAdapter component.

While processing traffic by HNQueue component (see ReceiveQueue) you should remember that HNQueue object can be deleted only after calling CloseAdapter, otherwise an early HNQueue object deletion will lead to the application crash.
See also:HNAdapter, OpenAdapter, HNQueue, ReceiveQueue