Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.9k views
in .NET FTP by (160 points)
On connecting my local proxy is returning

'230 fwint.thales FTP proxy (Version 5.0) ready'

This causes an exception (with the string above in it) and the connection is not opened.

I have tried setting StrictReturnCodes to false but that does not help.

I am using version 1.1.9.

Any suggestions ?

7 Answers

0 votes
by (162k points)
230 is one of the accepted responses (which indicates no password required).

You'll need to provide the stack trace and the log for us to see what is going on.

On connecting my local proxy is returning

'230 fwint.thales FTP proxy (Version 5.0) ready'

This causes an exception (with the string above in it) and the connection is not opened.

I have tried setting StrictReturnCodes to false but that does not help.

I am using version 1.1.9.

Any suggestions ?
0 votes
by (160 points)
The exception is occuring on the Connect method.


SOURCE CODE
==========

FTPClient ftp = new FTPClient();
Logger.AddAppender(new FileAppender("c:/ftplog.txt"));
Logger.CurrentLevel = Level.ALL;
Logger log = Logger.GetLogger(typeof(FTPClient));

try
{

ftp.RemoteHost = "201.3.3.30";
ftp.Connect();
ftp.Login("anonymous@tgftp.nws.noaa.gov",pass);

...
}
catch (Exception ex)
{
log.Error("FTP Connect Exception", ex);
}




LOG CONTENTS
==========

DEBUG [EnterpriseDT.Net.Ftp.FTPClient] 20 Sep 2005 13:26:30.015 : Connecting to 201.3.3.30:21
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 20 Sep 2005 13:26:30.109 : 230 fwint.thales FTP proxy (Version 5.0) ready.
ERROR [EnterpriseDT.Net.Ftp.FTPClient] 20 Sep 2005 13:26:32.375 : FTP Connect Exception : fwint.thales FTP proxy (Version 5.0) ready.
at EnterpriseDT.Net.Ftp.FTPControlSocket.ValidateReply(FTPReply reply, String expectedReplyCode)
at EnterpriseDT.Net.Ftp.FTPControlSocket.ValidateConnection()
at EnterpriseDT.Net.Ftp.FTPControlSocket.Initialize(BaseSocket sock, IPAddress remoteHost, Int32 controlPort, Int32 timeout)
at EnterpriseDT.Net.Ftp.FTPControlSocket..ctor(IPAddress remoteHost, Int32 controlPort, Int32 timeout)
at EnterpriseDT.Net.Ftp.FTPClient.Connect(IPAddress remoteAddr, Int32 controlPort, Int32 timeout)
at EnterpriseDT.Net.Ftp.FTPClient.Connect()
at MetarReader.MetarReader.allStations() in c:\inetpub\wwwroot\metarreader\metar.asmx.cs:line 666
0 votes
by (162k points)
Ok, if you are happy to rebuild the DLL, try this:

In FTPControlSocket, modify the ValidateConnection() method to:

        internal void ValidateConnection()
        {            
            FTPReply reply = ReadReply();
            string[] validCodes = new string[]{"220", "230"};
            ValidateReply(reply, validCodes);
        }
0 votes
by
So that was a bug ?
0 votes
by (162k points)
No, your proxy server is returning the wrong code.

So that was a bug ?
0 votes
by
All working now with the suggested patch. Thanks.
0 votes
by (162k points)
We'll incorporate this patch into a future release, as even though the server shouldn't return this code, it does.

All working now with the suggested patch. Thanks.

Categories

...