0

I have a WPF application that communicates with several FTP servers. The application downloads files from the FTP servers at some fixed interval.

The file transfer process looks like this:

  1. Connect to a FTP server
  2. Download files
  3. Disconnect from the FTP server

To communicate with the FTP servers, my app is using the FtpWebRequest class.

  • Occasionally, there is a weird communication problem, when I send PWD or LIST commands, I get an exception ("The operation has timed out").

  • The only resolution for this problem is to restart the application.

  • I have tried using different FtpWebRequest configurations, but the situation did not improve.

What else should I try to resolve this issue?

jrh
  • 405
  • 2
  • 10
  • 29
grzes124
  • 33
  • 5
  • 1
    So once the problem starts happening, no connect ever succeeds anymore? – Martin Prikryl Dec 20 '17 at 20:03
  • 1
    Yes, precisely. – grzes124 Dec 20 '17 at 23:06
  • 1
    Show us log files for successful and failing connections: https://stackoverflow.com/q/9664650/850848 – Martin Prikryl Dec 21 '17 at 06:50
  • @AleksanderSolop Your spelling edits weren't quite right, the word you're looking for is "weird", not "wired". Also backticks are not recommended for non-code abbreviations like "ftp". Also "advise" is a verb, you're looking for "advice", which is a noun, i.e., when you "advise" a person, you give them "advice". You don't give them "advise". I'll suggest an edit. – jrh Jan 03 '18 at 15:00
  • CC @mehulmpt -- see comment above. – jrh Jan 03 '18 at 15:00
  • grzes124, could you provide the logs that Martin asked for? [`FTPWebRequest` is a fickle, unreliable, and poorly designed class even under the best of situations](http://mattmitchell.com.au/ftpwebrequest-is-broken/). As somebody who has been through [the pain of dealing with this class](https://codereview.stackexchange.com/questions/139474/ftp-file-upload-queue), I do not expect you to provide a traditional MVCE, but if you could at least say something like "Here's some code, if I use this code and run it for 80 days it breaks", that would help a little, if anything for a MS bug report. – jrh Jan 08 '18 at 14:46
  • Also if you possibly can, I recommend replacing your code that uses `FTPWebRequest` with some other class, even something third party, the Microsoft implementation has many deadly and hard to reproduce problems, and the API forces you back to string parsing very often, where the format of the string varies from one type of FTP server to another (e.g., IIS vs FileZilla vs vsftp, with no way to reliably detect what sort of server it is. – jrh Jan 08 '18 at 14:53

0 Answers0