Discussion:
Setting Timeout for InternetReadFile
(too old to reply)
Bond_james
2005-08-24 10:09:32 UTC
Permalink
Hi

I am using "InternetReadFile". Sometimes it hangs on somepages. I want
to set a timeout for this, so that it can wait only for that much time
and then quits.. Con anybody suggest me how can I do this

Byeeeeeeeeeeeee
Ismail Pazarbasi
2005-08-24 14:36:30 UTC
Permalink
Try:

DWORD dwTimeout = 30 * 1000; // 30 secs
if (!InternetSetOption(hinternet, INTERNET_OPTION_RECEIVE_TIMEOUT,
&dwTimeout, sizeof(DWORD)))
{
// oops, handle error
}

Ismail

Loading...