|
// The function of my program is to download a file from the website
I use the following two APIs to achieve this function:
m_hHTTP = InternetOpen (NULL, INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY, NULL, NULL, 0);
m_hServerFast = InternetOpenUrl (m_hHTTP, lpServer, szHead, lstrlenA (szHead), INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RELOAD, 0);
But when I call the following API to close the handle, the TCP connection established by the execution of the above function
It is not closed, and the TCP connection is in the Closed state.
InternetCloseHandle (m_hServerFast);
InternetCloseHandle (m_hHTTP);
Ask a master to help analyze whether the TCP connection opened by InternetOpenUrl needs other APIs to close it. |
|