Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).
no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

FTP IOException and SocketException

by Secil Unverdi » Fri Jun 14, 2013 6:25 pm

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.************ = Properties.Settings.Default.licenceOwner;
ftp.********* = 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 - System.Net.Sockets.SocketException: An I/O exception occurred.
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at Q9LMCYrADqjNKSv5HYL.KpQRy4rYp3EVwRHmEHA.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at jQUkNFVqTfxJmq0G8qG.0iUmMqV3EAlMP92AG7a.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [FTPClient] 13 Haz 2013 19:49:44.332 : at B74QFhVgUH3jEWnB3GO.r3neUHVykYpiq5HnJPi.Read(Byte[] , Int32 , Int32 )
DEBUG [FTPControlSocket] 13 Haz 2013 19:49:44.332 : Setting socket timeout=500
DEBUG [FTPControlSocket] 13 Haz 2013 19:50:28.801 : 250 Transfer completed successfully.
DEBUG [FTPControlSocket] 13 Haz 2013 19:50:28.801 : Setting socket timeout=60000
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : SystemException in Get(string,string)
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : System.IO.IOException: An I/O exception occurred.
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : at EnterpriseDT.Net.Ftp.FTPClient.oJWL6OSmx(String , String )
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : CAUSED BY - System.Net.Sockets.SocketException: An I/O exception occurred.
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : at Q9LMCYrADqjNKSv5HYL.KpQRy4rYp3EVwRHmEHA.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : at jQUkNFVqTfxJmq0G8qG.0iUmMqV3EAlMP92AG7a.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [FTPClient] 13 Haz 2013 19:50:28.801 : at B74QFhVgUH3jEWnB3GO.r3neUHVykYpiq5HnJPi.Read(Byte[] , Int32 , Int32 )


Could you please help on this issue? We are having these errors for six months randomly. Our network, application and security teams have worked on it. But there is no anomalies anywhere.

Regards,
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: FTP IOException and SocketException

by support2 » Fri Jun 14, 2013 11:25 pm

There is a limit to the number of files that can be transferred in a period of time - you might be exceeding it. Every transfer consumes one socket connection - and it takes time to free them up after closing. You may need to slow down your transfers.
no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

Re: FTP IOException and SocketException

by Secil Unverdi » Fri Jun 14, 2013 11:36 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: FTP IOException and SocketException

by support2 » Fri Jun 14, 2013 11:45 pm

no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

Re: FTP IOException and SocketException

by Secil Unverdi » Fri Jun 14, 2013 11:53 pm

no avatar
User

EDT Support

Posts

905

Joined

Mon Apr 26, 2004 3:03 pm

Re: FTP IOException and SocketException

by EDT Support » Tue Jun 18, 2013 12:44 pm

no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

Re: FTP IOException and SocketException

by Secil Unverdi » Tue Jun 18, 2013 4:32 pm

no avatar
User

EDT Support

Posts

905

Joined

Mon Apr 26, 2004 3:03 pm

by EDT Support » Tue Jun 18, 2013 5:05 pm

no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

by Secil Unverdi » Tue Jun 18, 2013 5:07 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Tue Jun 18, 2013 6:16 pm

no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

by Secil Unverdi » Tue Jun 18, 2013 6:18 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Tue Jun 18, 2013 6:28 pm

no avatar
User

Secil Unverdi

Posts

7

Joined

Fri Jun 14, 2013 5:46 pm

by Secil Unverdi » Wed Jun 19, 2013 4:59 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Wed Jun 19, 2013 11:02 pm


Who is online

Users browsing this forum: No registered users and 24 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron