internetsession类连接代码异常怎么会被触发?
CString command;
UINT ret = 0;
command.Format("%s%d","/-wvhttp-01-/video.cgi?v=h264&duration",duration);
CInternetSession inet = CInternetSession(_T("SimpleH264DataExtract"));
CHttpConnection* pHttpCon = inet.GetHttpConnection(hostIp,CHttpConnection::HTTP_VERB_GET
,80,NULL,NULL);
CHttpFile* pFile = pHttpCon->OpenRequest(CHttpConnection::HTTP_VERB_GET,
command,NULL,1,NULL,_T("HTTP/1.1"),NULL);
try{
pFile->SendRequest();
}
catch(CInternetException* e)
{
CString err;
TCHAR buf[512];
e->GetErrorMessage(buf,512);
err.Format(_T("Error occurred:%d/ %s\n"),e->m_dwError,buf);
::AfxMessageBox(err,MB_OK|MB_ICONEXCLAMATION);
ret = -1;
goto EXIT;
}