Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.2k views
in .NET FTP by (360 points)
Hi,
I use your edtFTPnet/PRO dll. I make a secure connection to Host(Mainframe) and get approx. 100.000 files by FTP. The source is Host and the destination is a distributed server.
Tne connection part in my code is below:

ProFTPClient ftp = new ProFTPClient();
ftp.RemoteHost = FTPAddress;

ftp.LicenseOwner = Properties.Settings.Default.licenceOwner;
ftp.LicenseKey = Properties.Settings.Default.licenceKey;
ftp.ServerValidation = ProFTPClient.ServerValidationType.None;
ftp.ConnectMode = FTPConnectMode.ACTIVE;
ftp.Connect();
ftp.Auth(ProFTPClient.SecurityMechanism.SSL);
ftp.Prot(ProFTPClient.DataProtectionType.Clear);
ftp.Login(username, password);

ftp.DataEncoding = Encoding.GetEncoding("ISO-8859-9");
ftp.TransferType = FTPTransferType.ASCII;
ftp.Timeout = 60000;
FTPConnection.LogLevel = LogLevel.Debug;
FTPConnection.LogFile = logPathFTP;

This program runs once a week and sometimes we have connection errors that cuts FTP. The error types are below.

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 10.24.96.92:64133
at EnterpriseDT.Net.Ftp.FTPClient.oJWL6OSmx(String , String )
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
at GenMetricCalculation.Utility.getProgramsByFTP(String genFolder, String FTPAddress, String username, String password)

System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 10.24.96.92:64957
at EnterpriseDT.Net.Ftp.FTPClient.oJWL6OSmx(String , String )
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
at GenMetricCalculation.Utility.getProgramsByFTP(String genFolder, String FTPAddress, String username, String password)


I read from your forums then I changed the connection type as ACTIVE and set the DEBUG level of the dll.
ftp.ConnectMode = FTPConnectMode.ACTIVE;

Then on my next try, I got the error below.

System.IO.IOException: An I/O exception occurred. ---> 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.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Q9LMCYrADqjNKSv5HYL.KpQRy4rYp3EVwRHmEHA.Receive(Byte[] , Int32 , Int32 , SocketFlags )
at jQUkNFVqTfxJmq0G8qG.0iUmMqV3EAlMP92AG7a.Receive(Byte[] , Int32 , Int32 , SocketFlags )
at B74QFhVgUH3jEWnB3GO.r3neUHVykYpiq5HnJPi.Read(Byte[] , Int32 , Int32 )
--- End of inner exception stack trace ---
at EnterpriseDT.Net.Ftp.FTPClient.oJWL6OSmx(String , String )
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
at GenMetricCalculation.Utility.getProgramsByFTP(String genFolder, String FTPAddress, String username, String password)


The debug log of your dll says :

DEBUG [FTPClient] 13 Haz 2013 19:48:43.629 : Setting local path to \\copftpv11\Ftproot\CMDBTransfer\BecubicGenProgramCollection\DVL.GARIAG01.GENSRC\CAGM1481
DEBUG [ProFTPControlSocket] 13 Haz 2013 19:48:43.629 : Creating active data socket on port 0
DEBUG [ProFTPControlSocket] 13 Haz 2013 19:48:43.629 : Binding 10.129.1.127
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.629 : ---> PORT 10,129,1,127,19,195
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.629 : 200 Port request OK.
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.629 : Created active data-socket: Protocol=None, ProxyConnector=, CompatibilityFlags=0
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.629 : ---> RETR CAGM1481
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.660 : 125 Sending data set DVL.GAR$AG01.GENSRC(CAGM1481) FIXrecfm 80
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.660 : Awaiting a direct connection on active data-channel (timeout=60000ms)
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.660 : Accepted connection on active data-channel established.
DEBUG [SecureSocket] 13 Haz 2013 19:48:43.707 : Shutdown(Both)
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.707 : Attempt to close unconnected active data-channel.
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.707 : 250 Transfer completed successfully.
DEBUG [FTPClient] 13 Haz 2013 19:48:43.723 : Setting local path to \\copftpv11\Ftproot\CMDBTransfer\BecubicGenProgramCollection\DVL.GARIAG01.GENSRC\CAGM1482
DEBUG [ProFTPControlSocket] 13 Haz 2013 19:48:43.738 : Creating active data socket on port 0
DEBUG [ProFTPControlSocket] 13 Haz 2013 19:48:43.738 : Binding 10.129.1.127
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.738 : ---> PORT 10,129,1,127,19,196
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.738 : 200 Port request OK.
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.738 : Created active data-socket: Protocol=None, ProxyConnector=, CompatibilityFlags=0
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.738 : ---> RETR CAGM1482
DEBUG [FTPControlSocket] 13 Haz 2013 19:48:43.754 : 125 Sending data set DVL.GAR$AG01.GENSRC(CAGM1482) FIXrecfm 80
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.754 : Awaiting a direct connection on active data-channel (timeout=60000ms)
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:48:43.754 : Accepted connection on active data-channel established.
ERROR [SecureNetworkStream] 13 Haz 2013 19:49:44.332 : Socket.Receive() failed
ERROR [SecureNetworkStream] 13 Haz 2013 19:49:44.332 : 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
ERROR [SecureNetworkStream] 13 Haz 2013 19:49:44.332 : at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
ERROR [SecureNetworkStream] 13 Haz 2013 19:49:44.332 : at Q9LMCYrADqjNKSv5HYL.KpQRy4rYp3EVwRHmEHA.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [SecureNetworkStream] 13 Haz 2013 19:49:44.332 : at jQUkNFVqTfxJmq0G8qG.0iUmMqV3EAlMP92AG7a.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [SecureNetworkStream] 13 Haz 2013 19:49:44.332 : at B74QFhVgUH3jEWnB3GO.r3neUHVykYpiq5HnJPi.Read(Byte[] , Int32 , Int32 )
DEBUG [ProFTPActiveDataSocket] 13 Haz 2013 19:49:44.332 : Attempt to close unconnected active data-channel.
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : Caught exception
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : System.IO.IOException: An I/O exception occurred.
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at B74QFhVgUH3jEWnB3GO.r3neUHVykYpiq5HnJPi.Read(Byte[] , Int32 , Int32 )
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at System.IO.StreamReader.ReadBuffer()
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at System.IO.StreamReader.ReadLine()
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at EnterpriseDT.Net.Ftp.FTPClient.IZ9xqFoU3v(StreamReader input)
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at EnterpriseDT.Net.Ftp.FTPClient.oJWL6OSmx(String , String )
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : CAUSED BY -

13 Answers

0 votes
by (162k points)
That's not SFTP. It's called FTPS, and they are very different protocols. See

http://www.enterprisedt.com/blogs/discu ... comparison
0 votes
by (360 points)
That's not SFTP. It's called FTPS, and they are very different protocols. See

http://www.enterprisedt.com/blogs/discu ... comparison


Can you give example code lines for the usage of SFTP? Is the usage different from FTPS?

Regards,
0 votes
by (162k points)
It's best to look at the how to examples in the User Guide:

http://www.enterprisedt.com/products/ed ... howto.html

Categories

...