Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
15.7k views
in .NET FTP by (400 points)
Hi!

I'm using edtFTPnet/Free to connect to an ftp server and download a file. This works perfectly if I use a .net Windows application, but if use it in .net Service application I cannot establish a connection to the server.
The error that appears is:

"Unable to read data from the transport connection: 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."

Is there any limitation of this version with service applications? What could be going wrong? :(

Any help you can provide is much appreciated.

15 Answers

0 votes
by (161k points)
Post the log from the successful application and we can compare them.
0 votes
by (400 points)
Hi, sorry for the late reply but I've been away from the office...

And thanks for helping me trying to figure this out.

DEBUG [FTPConnection] 14 Set 2010 09:32:06.819 : Set LocalDirectory='C:\Users\administrator\Documents\Visual Studio 2008\Projects\bin\Debug'
DEBUG [FTPClient] 14 Set 2010 09:32:06.821 : Connecting to ***.dyndns.org:21
DEBUG [HostNameResolver] 14 Set 2010 09:32:06.821 : Resolving ***.dyndns.org
DEBUG [HostNameResolver] 14 Set 2010 09:32:06.822 : ***.dyndns.org resolved to ***
DEBUG [FTPControlSocket] 14 Set 2010 09:32:06.910 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 14 Set 2010 09:32:06.910 : Command encoding=System.Text.ASCIIEncoding
DEBUG [FTPControlSocket] 14 Set 2010 09:32:06.911 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.010 : 220 Precise/RTCS FTP Ready
DEBUG [FTPConnection] 14 Set 2010 09:32:07.011 : Connected to ***.dyndns.org (instance=1)
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.014 : ---> USER contimetra
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.112 : 230 Logged in
DEBUG [FTPConnection] 14 Set 2010 09:32:07.113 : Successfully logged in
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.114 : ---> TYPE I
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.212 : 200 Type OK
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.212 : ---> PWD
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.312 : 257 "\" is currently working directory
DEBUG [FTPConnection] 14 Set 2010 09:32:07.314 : DownloadFile(C:\Users\administrator\AppData\Local\Temp\nivus129289267259196614.txt,nivusxxx.txt)
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.319 : NewActiveDataSocket(0)
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.319 : ---> PORT 10,0,0,20,238,116
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.412 : 200 Port command okay
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.412 : ---> RETR nivusxxx.txt
DEBUG [FTPControlSocket] 14 Set 2010 09:32:07.513 : 150 Opening data connection for RETR (***,-27987)
DEBUG [FTPActiveDataSocket] 14 Set 2010 09:32:07.611 : AcceptConnection() succeeded
DEBUG [FTPClient] 14 Set 2010 09:38:48.715 : Transferred 1668226 bytes from remote host
DEBUG [FTPControlSocket] 14 Set 2010 09:38:48.716 : 226 File sent OK - 1668226 bytes in 400.550 sec
DEBUG [FTPConnection] 14 Set 2010 09:38:48.717 : Closing connection (instance=1)
DEBUG [FTPFileFactory] 14 Set 2010 09:38:48.718 : Defaulting to Unix parsing
DEBUG [FTPControlSocket] 14 Set 2010 09:38:48.718 : ---> QUIT
DEBUG [FTPControlSocket] 14 Set 2010 09:38:48.813 : 221 Goodbye!


This is the log from the .NET application.
0 votes
by (161k points)
I'm sorry, there is no obvious problem there.

If you have access to a detailed server log, that will probably tell you why the server failed to connect back to the client.

We suggest using passive mode transfers.
0 votes
by (400 points)
Hi again,

Just wanted to let you know that I've been able to solve the problem finally... It was O.S. related.

I was downloading the file to the root of drive "c:" and windows 7 wasn't allowing the service application to place the file there(the .net application didn't have any problem downloading to the root), all I had to do was change the path for the downloaded file and the connection happened and the file downloaded without problems. :D

Thanks for your help anyway.
0 votes
by (161k points)
Glad you solved it. Really weird symptoms that didn't at all point to the real problem!

Categories

...