I call wininet\\InternetOpenUrlA, then wininet\\InternetReadFile and when I\'m done I call wininet\\InternetCloseHandle which returns True. That means that the handle succes
WinInet tries to re-use sockets where it can, so even when you release the handle it can choose to keep the socket active, ready for the next call to InternetOpen. Most of the time this is a good thing and you don't need to worry about it.
If you really need it to be closed immediately, you can fool WinInet into doing this by calling InternetSetOption after your final InternetCloseHandle:
...
InternetCloseHandle(hInternet);
InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
Doing this tells WinInet that global WinInet settings have changed (e.g. in the Registry) so it has no choice but to close all sockets and reset itself. However this obviously is not the intended usage and will have some performance impact if you are making lots of connections with WinInet.