CInternetSession问题记录

    xiaoxiao2022-07-06  218

    程序运行俩个小时后出现无法分配更多的 Internet 句柄错误,用的是CInternetSession类。这是哪儿出现了错误啊。是不是哪儿没有释放句柄啊。

    原因在于: 每个CInternetSession对象都Close了吗? 每个CInternetSession::GetHttpConnection得到的CHttpConnection*都Close了吗? 每个CInternetSession::GetHttpConnection得到的CHttpConnection*都delete了吗? 每个CInternetSession::OpenURL得到的CStdioFile*都Close了吗? 每个CInternetSession::OpenURL得到的CStdioFile*都delete了吗? 每个CHttpConnection::OpenRequest得到的CHttpFile*都Close了吗? 每个CHttpConnection::OpenRequest得到的CHttpFile*都delete了吗? 同时捕获CInternetException异常的时候需要在异常处理过程中注意上面的问题。

    最新回复(0)