Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.7k views
in .NET FTP by (1.8k points)
After I added my method to the FTPConnection.Error event I disabled my network connection.
Off course when trying to .Connect() there was an error.

But instead of firing this .Error event, an exception was thrown containing the standard winsock exception message.
"The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for"

This is off course not the desired behaviour.
I can catch this by wrapping the connect method in a try catch, but I guess I have to do this with every method I call then.
Wouldn't it be better if this was handled in the library.

Something like this:
if(Error == null){
   throw theException;
}
Error(theException);

Or am I missing something here?

4 Answers

0 votes
by (162k points)
ExFTPConnection has an Error event, not FTPConnection, which is what I assume you mean.

Can you post a log file?
0 votes
by (1.8k points)
I sure can ;)

Loglevel = all.
Started the program twice; Once with and once without connection.
As the key has not arrived yet (haven't seen my boss yet) it's still with the demo key.
DEBUG [LicenseProperties] 16 nov 2007 13:46:00.109 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet Express (fallback Software\Enterprise Distributed Technologies\edtFTPnet PRO)
DEBUG [LicenseProperties] 16 nov 2007 13:46:00.109 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet Express
DEBUG [LicenseProperties] 16 nov 2007 13:46:00.109 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet Express (fallback Software\Enterprise Distributed Technologies\edtFTPnet PRO)
DEBUG [LicenseProperties] 16 nov 2007 13:46:00.109 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet Express
INFO [LicenseProperties] 16 nov 2007 13:46:00.109 : Licence expiry date: 18/12/2007
INFO [LicenseProperties] 16 nov 2007 13:46:00.109 : Trial license
INFO [LicenseProperties] 16 nov 2007 13:46:00.109 : Licence expiry date: 18/12/2007
INFO [LicenseProperties] 16 nov 2007 13:46:00.109 : Trial license
DEBUG [ExFTPClient] 16 nov 2007 13:46:00.125 : Connecting to ftp.color.tc:21
DEBUG [HostNameResolver] 16 nov 2007 13:46:05.131 : ftp.color.tc resolved to 205.178.145.173
DEBUG [ExFTPControlSocket] 16 nov 2007 13:46:05.288 : Connecting directly to ftp-server 205.178.145.173:21
DEBUG [ExFTPControlSocket] 16 nov 2007 13:46:06.086 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=205.178.145.173, controlPort=21, timeout=120000
DEBUG [FTPControlSocket] 16 nov 2007 13:46:07.025 : 220 Serv-U FTP-Server v2.5n for WinSock ready...
DEBUG [EnterpriseDT.Net.Ftp.ExFTPConnection] 16 nov 2007 13:46:07.056 : Starting KeepAlive thread with period 30s
DEBUG [FTPControlSocket] 16 nov 2007 13:46:07.056 : ---> USER sdstds%0055089
DEBUG [FTPControlSocket] 16 nov 2007 13:46:07.697 : 331 User name okay, need password.
DEBUG [FTPControlSocket] 16 nov 2007 13:46:07.697 : ---> PASS ********
DEBUG [FTPControlSocket] 16 nov 2007 13:46:09.231 : 230 User logged in, proceed.
DEBUG [FTPConnection] 16 nov 2007 13:46:09.231 : Successfully logged in
DEBUG [FTPControlSocket] 16 nov 2007 13:46:09.231 : ---> TYPE I
DEBUG [FTPControlSocket] 16 nov 2007 13:46:10.076 : 200 Type set to I.
DEBUG [FTPControlSocket] 16 nov 2007 13:46:10.076 : ---> PWD
DEBUG [FTPControlSocket] 16 nov 2007 13:46:11.093 : 257 "/" is current directory.
DEBUG [FTPControlSocket] 16 nov 2007 13:46:11.108 : ---> CWD /
DEBUG [FTPControlSocket] 16 nov 2007 13:46:12.688 : 250 Directory changed to /
DEBUG [FTPControlSocket] 16 nov 2007 13:46:12.688 : ---> PWD
DEBUG [FTPControlSocket] 16 nov 2007 13:46:13.799 : 257 "/" is current directory.
DEBUG [LicenseProperties] 16 nov 2007 13:46:34.534 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet Express (fallback Software\Enterprise Distributed Technologies\edtFTPnet PRO)
DEBUG [LicenseProperties] 16 nov 2007 13:46:34.534 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet Express
DEBUG [LicenseProperties] 16 nov 2007 13:46:34.534 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet Express (fallback Software\Enterprise Distributed Technologies\edtFTPnet PRO)
DEBUG [LicenseProperties] 16 nov 2007 13:46:34.534 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet Express
INFO [LicenseProperties] 16 nov 2007 13:46:34.549 : Licence expiry date: 18/12/2007
INFO [LicenseProperties] 16 nov 2007 13:46:34.549 : Trial license
INFO [LicenseProperties] 16 nov 2007 13:46:34.549 : Licence expiry date: 18/12/2007
INFO [LicenseProperties] 16 nov 2007 13:46:34.549 : Trial license
DEBUG [ExFTPClient] 16 nov 2007 13:46:34.549 : Connecting to ftp.color.tc:21


Created a demo project for this purpose. If required, I can send it.
Big thanks
Boris
0 votes
by (162k points)
Currently the Error event is only supported for asynchronous methods. Non-asynchronous messages throw exceptions if there is an error.
0 votes
by (1.8k points)
Ok, thanks :)

Categories

...