views:

476

answers:

1

Hi All,

My program puts a file into a remote host using HTTP. For some unavoidable reasons, the remote hosts needs some time to acknowledge the final packet of the data transmission. More time than the default timeout, which according to my experience is around 30 seconds. Therefore I wanted to increase the timeout to 5 minutes, using this code:

DWORD dwTimeout= 300000; // 5 minutes
pFtpConnection->SetOption( // KB176420: this has no effect on some
  INTERNET_OPTION_SEND_TIMEOUT, dwTimeout); // old versions of IE.
pFtpConnection->SetOption(
  INTERNET_OPTION_RECEIVE_TIMEOUT, dwTimeout);
pFtpConnection->SetOption( // NB: Docs say these 2 are not implemented.
  INTERNET_OPTION_DATA_SEND_TIMEOUT, dwTimeout); 
pFtpConnection->SetOption( // our own tests show that they are!
  INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, dwTimeout);

This is MFC code which boils down to calling

InternetOption(hConnection, INTERNET_XXX, &dwTimeout, sizeof(dwTimeout))

The problem is that this code apparently fails to modify the timeout on a non negligeable proportion of computers where the program is used.

How can I reliably set the data connection timeout?

TIA,

Serge Wautier.

A: 

It looks like this WinInet isue can'tbe solved reliably.

I eventually switched from WinInet to Ultimate TCP/IP.

Serge - appTranslator