Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.5k views
in .NET FTP by (200 points)
Hye,

I'm using the edtftpnet-1.2.5 free edition. It is a superb utility that has helped out a lot, but now running into some problems:

I'm downloading a textfile, doing all kind of manipulations to this file (which take quite some time), and then try to upload the file back to the FTP-server. It's in this last part that things are going wrong.
I'm using the same connection for the download as well as the upload, first checking if connected still true (otherwise reconnecting). But although code is saying I'm still connected, I cannot send a command to the server and getting the following error:

System.SystemException: Unexpected null reply received
at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadReply() in C:\Desktop\FTP\edtftpnet-1.2.5\src\net\ftp\FTPControlSocket.cs:line 785
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command) in C:\Desktop\FTP\edtftpnet-1.2.5\src\net\ftp\FTPControlSocket.cs:line 749
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketPASV() in C:\Desktop\FTP\edtftpnet-1.2.5\src\net\ftp\FTPControlSocket.cs:line 607
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode) in C:\Desktop\FTP\edtftpnet-1.2.5\src\net\ftp\FTPControlSocket.cs:line 464
at EnterpriseDT.Net.Ftp.FTPClient.InitExists(String remoteFile) in C:\Desktop\FTP\edtftpnet-1.2.5\src\net\ftp\FTPClient.cs:line 2314
at EnterpriseDT.Net.Ftp.FTPClient.Exists(String sRemoteFile) in C:\Desktop\FTP\edtftpnet-1.2.5\src\net\ftp\FTPClient.cs:line 3318

Is this a familiar problem to the version or am I doing something wrong?

Any help would be very appreciated!

Tkx

Kris

4 Answers

0 votes
by (162k points)
Unfortunately the connected() method isn't too reliable - it delegates to the .NET Socket method, which itself is unreliable according to the documentation.

It's possible the socket is timing out - you may be better off downloading, disconnecting, and reconnecting when you are ready to upload again.
0 votes
by (200 points)
Tkx for the quick answer Bruce! I understand...

Isn't there another way however like just using a new socket, without having to reconnect?
Reason why could be the time it takes to connect and login to an ftp-server, and wanting to keep this 'lost' time as minimalised as possible...
0 votes
by (200 points)
Would it e.g. be an option to use the NOOP command before I do my upload, whereas if this throws an error that I can catch it and only run the login at this time?

Thanks in advance...
0 votes
by (162k points)
You might as well do the same with the upload rather than calling NOOP - if you get an exception, disconnect and reconnect.

Categories

...