Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

timeout management in FTP put

12 views
Skip to first unread message

Serge Wautier

unread,
Dec 15, 2008, 5:13:07 PM12/15/08
to
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(INTERNET_OPTION_SEND_TIMEOUT, dwTimeout); //
NB: KB176420. This one has no effect on some old versions of IE.
pFtpConnection->SetOption(INTERNET_OPTION_RECEIVE_TIMEOUT, dwTimeout); //
pFtpConnection->SetOption(INTERNET_OPTION_DATA_SEND_TIMEOUT, dwTimeout);
// NB: Docs say these 2 are not implemented.
pFtpConnection->SetOption(INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, dwTimeout);
// our own tests show that they are!

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.

0 new messages