An existing connection was forcibly closed by the remote host

0 votes
asked Dec 3, 2015 by MrBeneteau (180 points)

Here's the log

2015-12-03 11:20:57.169 DEBUG Ftp(61)[50] Info: Starting data transfer.
2015-12-03 11:20:57.169 INFO Ftp(61)[50] Command: TYPE A
2015-12-03 11:20:57.190 INFO Ftp(61)[50] Response: 200 Type set to A.
2015-12-03 11:20:57.190 DEBUG Ftp(61)[50] Info: Accepting data connection.
2015-12-03 11:20:57.192 INFO Ftp(61)[50] Command: PORT 10,10,20,5,167,153
2015-12-03 11:21:16.085 DEBUG Ftp(61)[50] Info: Control connection failed, closing current data connection.
2015-12-03 11:21:16.085 DEBUG Ftp(61)[50] Info: Error while starting data transfer: Rebex.Net.FtpException: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: 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 Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.IS.BC()
at Rebex.Net.IS.BC(Int32 A)
at Rebex.Net.IS.GC(String& A, Int32 B)
at Rebex.Net.IS.HC(Int32 A)
at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
--- End of inner exception stack trace ---
at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
at Rebex.Net.Ftp.KM(EndPoint A)
at Rebex.Net.Ftp.SM(String A, Boolean B, VS C, WP D, Int64 I, FtpTransferState J)
2015-12-03 11:21:16.085 ERROR Ftp(61)[50] Info: Rebex.Net.FtpException: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: 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 Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.IS.BC()
at Rebex.Net.IS.BC(Int32 A)
at Rebex.Net.IS.GC(String& A, Int32 B)
at Rebex.Net.IS.HC(Int32 A)
at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
--- End of inner exception stack trace ---
at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
at Rebex.Net.Ftp.KM(EndPoint A)
at Rebex.Net.Ftp.SM(String A, Boolean B, VS C, WP D, Int64 I, FtpTransferState J)
at Rebex.Net.Ftp.PO(String A, Boolean B, Stream C, Int64 D, String I, WP J)
2015-12-03 11:21:16.085 ERROR Ftp(61)[50] Info: Rebex.Net.FtpException: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: 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 Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at Rebex.Net.IS.BC()
at Rebex.Net.IS.BC(Int32 A)
at Rebex.Net.IS.GC(String& A, Int32 B)
at Rebex.Net.IS.HC(Int32 A)
at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
--- End of inner exception stack trace ---
at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
at Rebex.Net.Ftp.KM(EndPoint A)
at Rebex.Net.Ftp.SM(String A, Boolean B, VS C, WP D, Int64 I, FtpTransferState J)
at Rebex.Net.Ftp.PO(String A, Boolean B, Stream C, Int64 D, String I, WP J)

Any ideas how to fix it?

Thanks!

Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Dec 4, 2015 by Tomas Knopp (58,580 points)

Hello, the error above seems very similar to the one you already asked about at the other forum question.

Please see my comment there and try to do the suggested (try using passive mode by setting ftp.Passive = true)

...