I tried out the fixed dll that you sent me. It is half way there. I'll try to explain the best that I can. My app is a C# form that allows you to enter in some basic FTP settings (server, username,password,port, active/pasv,active ip/ports,remote folder, local folder,etc.) Then you click a button and it logs into the server, changes to the remote folder, checks the local folder for any files, and uploads those files to the remote server.
I started using the fix that you sent, and when I run the app and click the "Send" button, the timeout works as it should and I get the following exception and log file:
Exception:
System.IO.IOException: Failed to accept connection within timeout period (25000)
at al.b(Int32 A_0)
at h.d()
at h.e()
at EnterpriseDT.Net.Ftp.FTPClient.Dir(String dirname, Boolean full)
at EnterpriseDT.Net.Ftp.FTPClient.Dir()
at FTPConfig.MainForm.btnTest_Click(Object sender, EventArgs e) in c:\documents and settings\adsi480\desktop\drop box\projects\ftpservice - junk\ftpconfig\mainform.cs:line 921
Log:
INFO [FTPConfig.MainForm] 10 Apr 2006 09:35:35.468 : ActivePortRange = 12000 - 13000
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:35:35.484 : Licence expiry date: 5/27/2006
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:35:35.484 : Trial license
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:35:35.484 : Connecting to ftpserver:69
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:35:44.359 : ftpserver resolved to 192.168.4.200
DEBUG [b8] 10 Apr 2006 09:35:44.375 : Connecting directly to ftp-server 192.168.4.200:69
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.515 : 220-Boz's FTP Server
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.703 : 220 FileZilla Server version 0.9.14a beta
DEBUG [b8] 10 Apr 2006 09:35:44.703 : Created control-socket: ImplicitFTPS=False, SocksContext=, RemoteHost=0, controlPort=192.168.4.200, timeout=69, CompatibilityFlags=0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.703 : ---> USER kioware
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.765 : 331 Password required for kioware
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.781 : ---> PASS ********
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.828 : 230 Logged on
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.828 : ---> TYPE I
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.890 : 200 Type set to I
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.890 : ---> CWD FTP Test/SubFolder/
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.953 : 250 CWD successful. "/FTP Test/SubFolder" is current directory.
DEBUG [b8] 10 Apr 2006 09:35:44.953 : Creating active data socket on port 12000
DEBUG [b8] 10 Apr 2006 09:35:44.953 : Binding 192.168.7.193
INFO [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.968 : Forcing use of fixed IP for PORT command
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:44.968 : ---> PORT 207,181,186,233,46,224
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:45.031 : 200 Port command successful
DEBUG [h] 10 Apr 2006 09:35:45.031 : Created active data-socket: Protocol=b, SocksConnector=, CompatibilityFlags=0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:45.031 : Using active port range
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:45.031 : Next active port will be: 12001
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:45.031 : ---> NLST
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:35:45.093 : 150 Opening data channel for directory list.
DEBUG [h] 10 Apr 2006 09:35:45.093 : Awaiting a direct connection on active data-channel.
WARN [EnterpriseDT.Net.Ftp.FTPClient] 10 Apr 2006 09:36:10.109 : Caught exception closing data socket : Object reference not set to an instance of an object.
at h.a()
at h.c()
at EnterpriseDT.Net.Ftp.FTPClient.a()
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:36:35.562 : ---> QUIT
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:36:35.562 : 425 Can't open data connection.
This all is fine. The timeout works and the log makes sense. Except this line has me a little worried:
WARN [EnterpriseDT.Net.Ftp.FTPClient] 10 Apr 2006 09:36:10.109 : Caught exception closing data socket : Object reference not set to an instance of an object.
at h.a()
at h.c()
at EnterpriseDT.Net.Ftp.FTPClient.a()
After clicking the button once and getting that failure (as expected), I click the button again. This time, I get a completely different log and execption, and I think it is related to that one entry in the log file that I referred to just above. Here is the exception and log from the second and all subsequent button clicks:
Exception:
System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at ax.b(EndPoint A_0)
at al.a(EndPoint A_0)
at b8.a(Int32 A_0)
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketActive()
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode)
at EnterpriseDT.Net.Ftp.FTPClient.Dir(String dirname, Boolean full)
at EnterpriseDT.Net.Ftp.FTPClient.Dir()
at FTPConfig.MainForm.btnTest_Click(Object sender, EventArgs e) in c:\documents and settings\adsi480\desktop\drop box\projects\ftpservice - junk\ftpconfig\mainform.cs:line 921
Log:
INFO [FTPConfig.MainForm] 10 Apr 2006 09:37:12.515 : ActivePortRange = 12000 - 13000
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:37:12.515 : Licence expiry date: 5/27/2006
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:37:12.515 : Trial license
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:37:12.515 : Connecting to ftpserver:69
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 10 Apr 2006 09:37:18.375 : ftpserver resolved to 192.168.4.200
DEBUG [b8] 10 Apr 2006 09:37:18.375 : Connecting directly to ftp-server 192.168.4.200:69
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:37:18.500 : 220-Boz's FTP Server
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:37:18.750 : 220 FileZilla Server version 0.9.14a beta
DEBUG [b8] 10 Apr 2006 09:37:18.750 : Created control-socket: ImplicitFTPS=False, SocksContext=, RemoteHost=0, controlPort=192.168.4.200, timeout=69, CompatibilityFlags=0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:37:18.750 : ---> USER kioware
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:37:18.812 : 331 Password required for kioware
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:37:18.812 : ---> PASS ********
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 10 Apr 2006 09:37:18.875 : 230 Logged on
DEBUG [EnterpriseDT.Net.Ft