DPM wrote:
> Hi,
>
> I have an application whch downloads files from a server using
> InternetReadFile() of WinINet.dll as the sample method calls given below
> When download small files in size it works fine. But when downloading
> large files a timeout occurs and returns error code 12002.
> It hangs for a long time at InternetReadFile()
>
> Following is what was gathered over a LAN.
> Size MB Time taken S Success
> 32 42.11 Yes
> 125 207.03 Yes
> 127 260.61 Yes
> 128 600.52 No, hangs at InternetReadFile()
> 159 600.52 No, hangs at InternetReadFile()
>
> Just for 1mb increase it hangs up for 600s when compared with 127mb
>
> This was tested on WinXP SP2 with IE 7.0.5730.11
>
>
> Following windows registry changes were done but there was no improvement.
>
> 1. Increased set the ReceiveTimeOut to 600000ms(10 minutes),
> HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet
> settings
>
> 2. Set the KeepAliveTimeout and ServerInfoTimeOut to 300000(5 minutes) in
> HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet
> settings
>
>
> Following is a sample of the method calls in order
>
> DECLARE INTEGER InternetSetOption IN WININET.DLL INTEGER, INTEGER, INTEGER
> @, INTEGER
> dwTimeoutSecs = 600*1000
>
InternetSetOption(hIPSession,INTERNET_OPTION_CONNE CT_TIMEOUT,@dwTimeoutSecs,
4)
>
InternetSetOption(hIPSession,INTERNET_OPTION_DATA_ RECEIVE_TIMEOUT,@dwTimeOut
Secs,4)
>
InternetSetOption(hIPSession,INTERNET_OPTION_DATA_ SEND_TIMEOUT,@dwTimeOutSec
s,4)
>
>
hHTTPResult=HttpOpenRequest(hHTTPSession,"POST",tc Page,NULL,NULL,NULL,INTERN
ET_FLAG_RELOAD,0)
>
lnRetval=HttpSendRequest(hHTTPResult,tcHeaders,LEN (tcHeaders),lcPostBuffer,t
nPostSize)
> lnRetval =
>
HttpQueryInfo(hHTTPResult,HTTP_QUERY_RAW_HEADERS_C RLF,@lcHeaders,@lnHeaderSi
ze,NULL)
>
> lhFile = FCREATE(tcFileName)
> DO WHILE .T.
> lcReadBuffer = SPACE(4096)
> lnBytesRead = 0
> lnSize = LEN(lcReadBuffer)
>
>
> lnRetval=InternetReadFile(hHTTPResult,@lcReadBuffe r,lnSize,@lnBytesRead)
> FWRITE(lhFile,lcReadBuffer,lnBytesRead)
> ENDDO
> FCLOSE(lhFile)
>
> InternetCloseHandle(hHTTPResult)
>
>
> Could someone please advice how to increase the download file size,
> or is there any other funtion call which will enable this?
Forwarded via crosspost to microsoft.public.internetexplorer.general
--
Vincenzo Di Russo
Microsoft® MVP - Most Valuable Professional since 2003
Windows Internet Explorer, Windows Desktop Experience & Security
My MVP Profile:
https://mvp.support.microsoft.com/profile/Vincenzo
My Blog:
http://blogs.dotnethell.it/vincent/