Packet Sniffer SDK VCL Edition

HNFileAdapter :: Methods :: CloseFile

 Previous Next

Close the CAP file.

Syntax:

function CloseFile(): DWORD;

Return values:

HNERR_OKCAP file has been closed successfully.

Description:

Use CloseFile function to close CAP file opened/created by HNFileAdapter.OpenFile/HNFileAdapter.CreateFile functions.

The function releases OS resources allocated for work with CAP file and stops HNFileAdapter internal threads.

While processing traffic by HNQueue component (see HNFileAdapter.Queue) you should remember that HNQueue object can be deleted only after CloseFile function call, otherwise an early HNQueue object deletion will lead to the application crash.
See also:HNFileAdapter, HNFileAdapter.OpenFile, HNFileAdapter.CreateFile, HNQueue, HNFileAdapter.Queue