I'm using the open source ftp library and I'm getting an exception thrown when I'm trying to download some large files. I am running through a script in which I am trying to download 20+ files. With most of the files being around 100MB. The code works great on my 2 different development environments (with the file downloads completing with no errors). But, when I put this on the production server, the files don't finish downloading and an Exception is thrown.
My development environments are:
Windows XP Pro SP2 (32bit)
Windows Server 2003 SP1 (Standard Edition)
The production environment is:
Windows Server 2003 R2 SP1 (Standard x64 Edition)
Here is the Exception:
EnterpriseDT.Net.Ftp.FTPException: The FTP client has not yet connected to the server. The requested action cannot be performed until after a connection has been established.
at EnterpriseDT.Net.Ftp.FTPClient.CheckConnection(Boolean shouldBeConnected)
at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransferOnError()
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
at EnterpriseDT.Net.Ftp.FTPConnection.DownloadFile(String localPath, String remoteFile)
at LoadData.FtpDataFiles..ctor(Settings settings) in C:\PolicyDBPrograms\SourceCode\trunk\LoadData\FtpDataFiles.cs:line 183
at LoadData.Program.Main(String[] args) in C:\PolicyDBPrograms\SourceCode\trunk\LoadData\Program.cs:line 175
I had a look at this thread
http://www.enterprisedt.com/forums/viewtopic.php?t=2496 but I'm not using a proxy, and nothing else in the thread seemed to help me out at all. But the
FTPConnection object that I am using does not have a
ServerWakeupInterval that I can set. And setting the
Timeout only seems to delay how long it takes the exception to be thrown.
Here are 4 sets of logs from the program. The ApplicationLog is logging that is from my application, and the other is the edtFTP log. The last log set (4) has the log option set to log ALL, so it's a big file.
http://tehone.com/files/misc/LoadData-ApplicationLogs-FtpFailure.zip
And here is my code:
http://tehone.com/files/misc/LoadData-FTPDataFiles.cs.txt. In this code, I have hooked into a number of events just to log them for trying to debug this. The only event that I actually need to hook into is the
BytesTransferred event.
Well, I'm open to any suggestions on how to get around this. I guess I could try to catch this exception and re-download the file (as was suggested in the other thread). But, since this is just a
FTPException, the exception could be from something other then the connection closing. Is there any way to just catch a connection exception? Maybe something like, FTPConnectionException? And, if I do catch then try to redownload, do I just need to call
Connect() again then retry the
DownloadFile? Or do I have to re-create the
FTPConnection and set all it's properties again and all that?
Also, when using the
FTPConnection, is there any way to set the
ServerWakeupInterval?
Ok, thanks in advance for any info you can provide.