Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
13.6k views
in .NET FTP by (280 points)
Hello

I am trying to use the edtftpnet-1.2.2.dll with C#. When I run the Login() method in a Desktop application everything works properly, but the same code, with the same Server, Password, Port and User, in an Asp.Net Application, always says that the host didn't respond. Am I missing any configuration? It seems to me that some permission under IIS is blocking me.

Thanks in advance for your help.

Artur

17 Answers

0 votes
by (162k points)
Can you get a log file or a stack trace? What's the exact error message?
0 votes
by (280 points)
The message I receive is:

"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

The problem is that the server responded when I run the same code on the Desktop Application.
0 votes
by (340 points)
I am receiving the same message. There is no InnerException. Following is the stack trace:

System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at n.a(String A_0, Int32 A_1) at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketPASV() at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode) at EnterpriseDT.Net.Ftp.FTPClient.Dir(String dirname, Boolean full)

I am using edtFTPnet/Pro 2.0. I am using the ProFTPClient class. I can connect and move to a new directory, but when I request a list of files, this error is returned after a long pause. When I am not using FTPS everything works fine. The only difference in the code between these two modes is the call "Auth(ProFTPClient.SecurityMechanism.TLS);". I am using "ServerValidation = ProFTPClient.ServerValidationType.None;" to avoid any SSL problems. I am running FtpShell (http://www.ftpshell.com/) because I experienced authentication problems with your server.

Please help. I have a client who needs this functioning soon.

Thanks
0 votes
by (51.6k points)
Can you please enabled logging and post the relevant part of the log for each case: the one where it works and the one where it doesn't.

- Hans (EDT Support)
0 votes
by (340 points)
Hans,

If you will tell me how to enable logging, or where to find the information (the help file that installed with your package isn't working), I will enable it and post the relevent data.

Thanks
0 votes
by (51.6k points)
FTPConnection has static properties called LogLevel, LogFile, LogToConsole and LogToTrace. If you set LogLevel to LogLevel.Debug and then set one of ther other three properties you'll get logging to a file, the console, or the trace, respectively.

It worries me that the help is not working for you. This is the first report we've had of it failing and I'd really appreciate your assistance in troubleshooting it, if you don't mind. What happens when you select the help item from the edtFTPnet/PRO Start Menu group?

- Hans (EDT)
0 votes
by (340 points)
Thanks for the reply. I got logging working another way (using Logger.AppendLogger) and will post the results after this. When I select help from the start menu, nothing happens. The hard drive shows a blurb of activity (maybe 1 second) then nothing. Here is the contents of H2Reg_Log.txt:

==============================================================================
Log File: C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help\H2Reg_Log.txt
Date: 5/31/2006 1:45:13 PM
Operating System: Windows XP 5.1 (Build 2600) Service Pack 2
SysLocale.DefaultLCID: 0x0409 (1033)
SysLocale.PriLangID: 0x0009 (9)
SysLocale.SubLangID: 0x0001 (1)
DecimalSeparator: .
-------------------------------------------------------------------------------
EXE Path = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help\H2Reg.exe
EXE Version = 1.4.3.0
Cmdline Param(s) = -r | CmdFile=H2Reg_cmd.ini
Actual CmdLine = "C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help\H2Reg.exe" -r CmdFile=H2Reg_cmd.ini
_RunDir = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help
_ModuleName = H2Reg.exe
_ModuleDir = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help
_ModulePath = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help\H2Reg.exe
Module Version = 1.4.3.0
-------------------------------------------------------------------------------
_hhInstalled = YES
_hhVerStr = 5.2.3790.2453
_hhFriendlyVerStr = > 1.4a
-------------------------------------------------------------------------------
_ieInstalled = YES
_ieVerStr = 6.0.2900.2877
_ieFriendlyVerStr = Internet Explorer 6 (Windows XP SP2)
===============================================================================
MS Help 2.x Runtime Found: YES
2.5.50727.42, C:\Program Files\Common Files\Microsoft Shared\Help\hxds.dll
2.5.50727.42, C:\Program Files\Common Files\Microsoft Shared\Help\hxvz.dll
NT Admin Log On: YES
PC Language ID = en
-------------------------------------------------------------------------------
Quiet Mode (-Q): No
Registration Mode (-R): Yes
UnRegistration Mode (-U): No
Append Log Mode (-A): No
No NT Admin Check (-N): No
Merge Indexes Mode (-M): No
Cmd Script File (CmdFile=): H2Reg_cmd.ini
User Dir 1 (UserDir1=):
User Dir 2 (UserDir2=):
User Dir 3 (UserDir3=):
User Dir 4 (UserDir4=):
===============================================================================
CmdFile = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help\H2Reg_cmd.ini
<windir> = C:\WINDOWS
<winsysdir> = C:\WINDOWS\system32
<programfilesdir> = C:\Program Files
<exedir> = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help
<exedirparent> = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO
<cmdfiledir> = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO\Help
<cmdfiledirparent> = C:\Program Files\Enterprise Distributed Technologies\edtFTPnet PRO
<userdir1> =
<userdir1parent> =
<userdir2> =
<userdir2parent> =
<userdir3> =
<userdir3parent> =
<userdir4> =
<userdir4parent> =
-------------------------------------------------------------------------------
[Reg_Namespace]
edtFTPnetPRO|edtFTPnetPRO.HxC|edtFTPnet/PRO 2.0

[Reg_Title]
edtFTPnetPRO|edtftpnetpro|1033|edtftpnetpro.HxS|edtftpnetpro.HxS||||||
edtFTPnetPRO|edtftpnetpro-api|1033|edtftpnetpro-api.HxS|edtftpnetpro-api.HxS||||||

[Reg_Plugin]
ms.vscc+|_DEFAULT|edtFTPnetPRO|_DEFAULT|edtFTPnetPRO.HxA

[Reg_Filter]

[UnReg_Namespace]
edtFTPnetPRO
0 votes
by (340 points)
Hans,

Below are the two log contents. In the code, the only difference is the call to Auth. The code hangs at Dir. Thanks for any help.

Failed FTPS:

DEBUG [t] 7 Jun 2006 09:26:01.609 : Looking for trial license
DEBUG [t] 7 Jun 2006 09:26:01.609 : Trial key='170-2052-4108-1124', owner='trialuser', product='edtftpnetpro'
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:26:01.609 : Licence expiry date: 7/12/2006
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:26:01.609 : Trial license
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:26:01.609 : Connecting to ftp.aaoamerica.org:21
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:26:01.640 : ftp.aaoamerica.org resolved to 67.94.102.162
DEBUG [n] 7 Jun 2006 09:26:01.656 : Connecting directly to ftp-server 67.94.102.162:21
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:01.796 : 220- FTPshell Server Service (Version 3)
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:01.796 : 220
DEBUG [n] 7 Jun 2006 09:26:01.796 : Created control-socket: ImplicitFTPS=False, SocksContext=, RemoteHost=67.94.102.162, controlPort=21, timeout=120, CompatibilityFlags=0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:01.812 : ---> AUTH TLS
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:01.890 : 234 AUTH command accepted. Setting up SSL/TLS connection
DEBUG [n] 7 Jun 2006 09:26:01.890 : Beginning d handshake.
DEBUG [n] 7 Jun 2006 09:26:02.484 : d handshake complete.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.484 : ---> PBSZ 0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.593 : 200 PBSZ Command accepted. Protection buffer set to 0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.593 : ---> PROT P
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.687 : 200 PROT Command accepted
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.687 : ---> USER TLC
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.750 : 331 User name okay, need password
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.765 : ---> PASS ********
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.859 : 230- Welcome To AAOA's FTP Server
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.859 : 230 User logged in, proceed
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.859 : ---> TYPE I
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.937 : 200 Command okay
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:02.937 : ---> CWD process
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:03.031 : 250 Path changed to "/process"
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:03.046 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:26:03.125 : 227 Entering Passive Mode (10,31,4,52,39,37)
DEBUG [n] 7 Jun 2006 09:26:03.125 : Connecting directly to ftp-server 10.31.4.52:10021
ERROR [n] 7 Jun 2006 09:26:23.984 : Failed to create connecting socket : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at c9.a(EndPoint A_0)
at ad.b(EndPoint A_0)
at n.a(BaseSocket A_0, IPAddress A_1, Int32 A_2)
at n.a(String A_0, Int32 A_1)


Successful FTP log:

DEBUG [t] 7 Jun 2006 09:29:44.875 : Looking for trial license
DEBUG [t] 7 Jun 2006 09:29:44.875 : Trial key='170-2052-4108-1124', owner='trialuser', product='edtftpnetpro'
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:29:44.875 : Licence expiry date: 7/12/2006
INFO [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:29:44.875 : Trial license
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:29:44.875 : Connecting to ftp.aaoamerica.org:21
DEBUG [EnterpriseDT.Net.Ftp.Pro.ProFTPClient] 7 Jun 2006 09:29:44.906 : ftp.aaoamerica.org resolved to 67.94.102.162
DEBUG [n] 7 Jun 2006 09:29:44.906 : Connecting directly to ftp-server 67.94.102.162:21
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.046 : 220- FTPshell Server Service (Version 3)
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.046 : 220
DEBUG [n] 7 Jun 2006 09:29:45.062 : Created control-socket: ImplicitFTPS=False, SocksContext=, RemoteHost=67.94.102.162, controlPort=21, timeout=120, CompatibilityFlags=0
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.062 : ---> USER TLC
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.140 : 331 User name okay, need password
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.140 : ---> PASS ********
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.203 : 230- Welcome To AAOA's FTP Server
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.203 : 230 User logged in, proceed
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.203 : ---> TYPE I
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.312 : 200 Command okay
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.312 : ---> CWD process
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.406 : 250 Path changed to "/process"
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.406 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.484 : 227 Entering Passive Mode (67,94,102,162,39,38)
DEBUG [n] 7 Jun 2006 09:29:45.500 : Connecting directly to ftp-server 67.94.102.162:10022
DEBUG [cz] 7 Jun 2006 09:29:45.546 : Created passive data-socket: Protocol=b, SocksConnector=, CompatibilityFlags=0, UseSSLClosure=False, WaitOnClose=False
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.546 : ---> NLST
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.640 : 150 File status okay; about to open data connection
DEBUG [cz] 7 Jun 2006 09:29:45.687 : Attempt to close unconnected passive data-channel.
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:45.843 : 226 Closing data connection
DEBUG [EnterpriseDT.Net.Ftp.FTPClient] 7 Jun 2006 09:29:45.843 : Found 2 listing lines
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:46.109 : ---> PASV
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:46.187 : 227 Entering Passive Mode (67,94,102,162,39,39)
DEBUG [n] 7 Jun 2006 09:29:46.187 : Connecting directly to ftp-server 67.94.102.162:10023
DEBUG [cz] 7 Jun 2006 09:29:46.250 : Created passive data-socket: Protocol=b, SocksConnector=, CompatibilityFlags=0, UseSSLClosure=False, WaitOnClose=False
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:46.250 : ---> RETR P20060531.xml
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 7 Jun 2006 09:29:46.328 : 150 File status okay; about to open data connection
DEBUG [cz] 7 Jun 2006 09:29:46.375 : Attempt to close unconnected passive data-channel.
DEBUG [EnterpriseDT.
0 votes
by (162k points)
Now this is interesting.

In your log, you have when you connect

"Connecting directly to ftp-server 67.94.102.162:21"

But for PASV, you then have

"Connecting directly to ftp-server 10.31.4.52:1002"

i.e. the server is returning a different IP address.

Before you connect to the server, try setting

AutoPassiveIPSubstitution = true

This will force the client to use the original IP address, not the one provided via PASV.
0 votes
by (340 points)
You beat me to the punch. I ended up writing my own FTP client to see if it was something in your library. Turns out if I would have paid closer attention to the log file I would have seen the same thing. After writing my own client, I received the error, "The server returned an address in response to the PASV command that is different than the address to which the FTP connection was made." There seems to be a problem at the hosts firewall. They are looking into the problem on their end.

I will try your suggestion. If it works you've made a sale. If it doesn't, I still appreciate all your help trying to resolve this. I'll let you know if it works.

Categories

...