Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.8k views
in .NET FTP by (200 points)
Dear all,
I have been receiving this exceptions so frequently.
My target server is IIS FTP with public ip.
But there is only 4 network hop to the server, so i dont think it is any network problem.

What could be the reasons for so frequent exceptions....?

ERROR [Philip.FTP.RISK_FTP.RISK_FTPClient] 30 May 2006 01:49:45.611 : CALP : Unable to write data to the transport connection.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at EnterpriseDT.Net.Ftp.FTPControlSocket.WriteCommand(String command)
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command)
at EnterpriseDT.Net.Ftp.FTPClient.set_TransferType(FTPTransferType value)
at Philip.FTP.Client.PhilipFTPClient.Download2()
DEBUG [EnterpriseDT.Net.Ftp.FTPControlSocket] 30 May 2006 01:49:45.611 : ---> QUIT
ERROR [Philip.FTP.RISK_FTP.RISK_FTPClient] 30 May 2006 01:49:45.611 : CALP : Unable to write data to the transport connection.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at EnterpriseDT.Net.Ftp.FTPControlSocket.WriteCommand(String command)
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command)
at EnterpriseDT.Net.Ftp.FTPClient.Quit()
at Philip.FTP.Client.PhilipFTPClient.Download2()

i understand that second exception is thrown since i try to issuse 'QUIT' after first exception.
Is it any config error on server side?
-----------------------------------
Unable to write data to the transport connection.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at EnterpriseDT.Net.Ftp.FTPControlSocket.WriteCommand(String command)
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command)
at EnterpriseDT.Net.Ftp.FTPClient.set_TransferType(FTPTransferType value)
------------------------------------
Unable to read data from the transport connection.

Thanks alot.
Hein

2 Answers

0 votes
by (162k points)
Is it possible that your FTP connection to the server has timed out? 300 sec is a common timeout, after which the server will terminate the connection. Does the log have any clues?
0 votes
by (200 points)
Following is the more detail error message and, i m logging InnerException here.
All the subsequent get() fails because of the first exception which is caused by reading the server reply.
I have seen in other threads that reading back the server reply too soon will cause error. But i am not sure abt this.

It is not caused by server time out since all the files does not exceed 10 KB and current time out limit is 15 minute.

I think i am hitting the max socket limit since i am running on 4 threads. And on each run, i am downloading 5 files max per thread. So it can be 20 files one after another in worst case. But it is not consistent either.

Can you suggest me where can be the problem?
My Server is IIS Ftp. I am running on WinXp Pro SP2.

Thanks alot.
Hein

ERROR [FTP.Client.PhilipFTPClient] 31 May 2006 20:21:54.534 : CALA : Unable to read data from the transport connection.
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadReply() in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 625
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 595
at EnterpriseDT.Net.Ftp.FTPControlSocket.SetDataPort(IPEndPoint ep) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 425
at EnterpriseDT.Net.Ftp.FTPControlSocket.NewActiveDataSocket(Int32 port) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 576
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketActive() in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 381
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 363
at EnterpriseDT.Net.Ftp.FTPClient.InitGet(String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1732
at EnterpriseDT.Net.Ftp.FTPClient.GetASCII(String localPath, String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1778
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1666
at Philip.FTP.Client.PhilipFTPClient.Download() in D:\FTP\Risk Download App\FTP\PhilipFTPClient.vb:line 300
ERROR [FTP.Client.PhilipFTPClient] 31 May 2006 20:21:54.550 : [RISK_FTPClient.OnDownloadErrorDetail]CALA060522_0815 : An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
ERROR [FTP.Client.PhilipFTPClient] 31 May 2006 20:21:54.597 : CALA : Unable to write data to the transport connection.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at EnterpriseDT.Net.Ftp.FTPControlSocket.WriteCommand(String command) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 610
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 592
at EnterpriseDT.Net.Ftp.FTPControlSocket.SetDataPort(IPEndPoint ep) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 425
at EnterpriseDT.Net.Ftp.FTPControlSocket.NewActiveDataSocket(Int32 port) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 576
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketActive() in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 381
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 363
at EnterpriseDT.Net.Ftp.FTPClient.InitGet(String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1732
at EnterpriseDT.Net.Ftp.FTPClient.GetASCII(String localPath, String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1778
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1666
at Philip.FTP.Client.PhilipFTPClient.Download() in D:\FTP\Risk Download App\FTP\PhilipFTPClient.vb:line 300
ERROR [FTP.Client.PhilipFTPClient] 31 May 2006 20:21:54.597 : [RISK_FTPClient.OnDownloadErrorDetail]CALA060522_0831 : An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
ERROR [FTP.Client.PhilipFTPClient] 31 May 2006 20:21:54.612 : CALA : Unable to write data to the transport connection.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at EnterpriseDT.Net.Ftp.FTPControlSocket.WriteCommand(String command) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 610
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 592
at EnterpriseDT.Net.Ftp.FTPControlSocket.SetDataPort(IPEndPoint ep) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 425
at EnterpriseDT.Net.Ftp.FTPControlSocket.NewActiveDataSocket(Int32 port) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 576
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketActive() in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 381
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPControlSocket.cs:line 363
at EnterpriseDT.Net.Ftp.FTPClient.InitGet(String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1732
at EnterpriseDT.Net.Ftp.FTPClient.GetASCII(String localPath, String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1778
at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile) in D:\FTP\Risk Download App\edtFTPnet\net\ftp\FTPClient.cs:line 1666
at Philip.FTP.Client.PhilipFTPClient.Download() in D:\FTP\Risk Download App\FTP\PhilipFTPClient.vb:line 300

Categories

...