Rebex.Net.Ftp Exception:An existing connection was forcibly closed by the remote host.

0 votes
asked Sep 6, 2016 by ssuser (120 points)

Hi,

I am facing an issue with connectivity while downloading files using Rebex library.[Exception details below]
This seems to be happening consistently.

I tried using KeepAliveDuringTransfer. Which dint resolve the issue.

Version of the library : 3.0.3484.0

Any help in this regard will be greatly appreciated.

Thanks in advance.

Source code :

Ftp FTPConn = new Ftp();

FTPConn.Encoding = Encoding.UTF8;
FTPConn.TransferMode = FtpTransferMode.Zlib;
FTPConn.Timeout = Generals.TRANSFERTIMEOUTINTERVAL;

FTPConn.Options = FtpOptions.KeepAliveDuringTransfer;
FTPConn.KeepAliveDuringTransferInterval = 120

using (Stream st = FTPConn.GetDownloadStream(filename))
{
StreamReader sr = new StreamReader(st, Encoding.UTF8);
string data = sr.ReadToEnd();
Generals.WriteFileData(String.Format("{0}\{1}", this.DataArchiveLogPath, filename), data, Encoding.UTF8);
return data;
}

Exception :
9/6/2016 4:43:04 AM: Void JobProcess(System.Object)
Exception:An existing connection was forcibly closed by the remote host.
StackTrace: at Rebex.Net.Ftp.WriteCommand(String command, String reportCommand)
at Rebex.Net.Ftp.WriteCommand(String command)
at Rebex.Net.Ftp.StartPassive()
at Rebex.Net.Ftp.StartTransfer(String command, FtpStream stream, Int64 serverOffset, FtpTransferState transfer)
at Rebex.Net.Ftp.GetDownloadStream(String remotePath, SeekOrigin origin, Int64 offset)
at Rebex.Net.Ftp.GetDownloadStream(String remotePath)

Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Sep 6, 2016 by Tomas Knopp (58,580 points)

Hi, the version that you have is more than 7 years old. Does the same issue also occur with the latest version?

...