West Wind Internet and Client Tools
FTPGetFileEx Question
Gravatar is a globally recognized avatar based on your email address. FTPGetFileEx Question
  Steve
  All
  Oct 7, 2019 @ 10:42am

Hi All,
Is there anyone that can share an example that implements/uses the lCancelDownload and OnFTPBufferUpdate functions of FTPGetFileEx please?

Sometimes, the file download fails, and this can take like 1 or 2 minutes before it comes back with the file download failed message. My hope is to detect when the file is not downloading and cancel say within about 30 seconds.

TIA,
Steve

Gravatar is a globally recognized avatar based on your email address. re: FTPGetFileEx Question
  Rick Strahl
  Steve
  Oct 7, 2019 @ 12:51pm

This is a tricky issue mainly because it requires coordination between the client and the server. In my experience most failures are due to drastically slowing connections (ie. there's still a trickle of data) that doesn't trigger a timeout, which is why it often doesn't fail when you think it should.

I don't think there are good solutions beyond using short timeouts - 30 seconds is too long IMHO. Timeouts should be in the 10-15 second range and I think the Windows default is 20.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: FTPGetFileEx Question
  Steve
  Rick Strahl
  Oct 7, 2019 @ 07:28pm

I saw the nConnectTimeout, but didn't see a timeout parm for the file download. What can I use to specify a timeout for the file download?

Thanks,
Steve

Gravatar is a globally recognized avatar based on your email address. re: FTPGetFileEx Question
  Rick Strahl
  Steve
  Oct 7, 2019 @ 10:21pm

The connection timeout is applied throughout the connection including send and receive.

+++ Rick ---

© 1996-2019