I am having trouble transferring large files to certain FTP servers.
Before I get into the details, I should mention that I was able to transfer a 5GB file to my GoDaddy FTP server with no problems in 5 1/2 hours.  But, I am having trouble with the servers that I am actually developing for.
On both uploads and downloads, I keep getting the following socket error:
Rebex.Net.FtpException: An existing connection was forcibly closed by the remote host.
My code looks like this:
_client = new Ftp { Timeout = -1 };
_client.Options |= FtpOptions.KeepAliveDuringTransfer | FtpOptions.UseLargeBuffers;
_client.KeepAliveDuringTransferInterval = 60; // FAILS WITHOUT THIS LINE AS WELL
_client.Connect(SessionSettings.Server);
_client.Login(SessionSettings.Username, SessionSettings.Password);
_client.PutFile(SourcePath, DestinationPath);
Here's what's in the log:
2011-04-22 08:31:48.544 INFO Ftp(2) Info: Connecting to ### using Ftp 3.0.4086.0.
2011-04-22 08:31:48.544 INFO Ftp(2) Info: Using proxy none.
2011-04-22 08:31:48.653 DEBUG Ftp(2) Info: Connection succeeded.
2011-04-22 08:31:48.684 INFO Ftp(2) Response: 220 *********************
2011-04-22 08:31:48.684 INFO Ftp(2) Command: USER ###
2011-04-22 08:31:48.747 INFO Ftp(2) Response: 331 Password required for ###.
2011-04-22 08:31:48.747 INFO Ftp(2) Command: PASS *********
2011-04-22 08:31:48.793 INFO Ftp(2) Response: 230 User logged in.
2011-04-22 08:31:48.793 INFO Ftp(2) Command: FEAT
2011-04-22 08:31:48.840 INFO Ftp(2) Response: 211-Extended features supported:
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  LANG EN*
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  UTF8
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  AUTH TLS;TLS-C;SSL;TLS-P;
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  PBSZ
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  PROT C;P;
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  CCC
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  HOST
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  SIZE
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  MDTM
2011-04-22 08:31:48.840 INFO Ftp(2) Response:  REST STREAM
2011-04-22 08:31:48.840 INFO Ftp(2) Response: 211 END
2011-04-22 08:31:48.856 INFO Ftp(2) Command: OPTS UTF8 ON
2011-04-22 08:31:48.903 INFO Ftp(2) Response: 200 OPTS UTF8 command successful - UTF8 encoding now ON.
2011-04-22 08:31:48.918 DEBUG Ftp(2) Info: Starting data transfer.
2011-04-22 08:31:48.918 INFO Ftp(2) Command: TYPE I
2011-04-22 08:31:48.965 INFO Ftp(2) Response: 200 Type set to I.
2011-04-22 08:31:48.965 INFO Ftp(2) Command: PASV
2011-04-22 08:31:49.027 INFO Ftp(2) Response: 227 Entering Passive Mode (38,107,151,16,208,30).
2011-04-22 08:31:49.027 DEBUG Ftp(2) Info: Establishing data connection to 38.107.151.16:53278.
2011-04-22 08:31:49.105 INFO Ftp(2) Command: STOR //TEST/5gigs-5.txt
2011-04-22 08:31:49.168 INFO Ftp(2) Response: 125 Data connection already open; Transfer starting.
2011-04-22 08:32:49.556 INFO Ftp(2) Command: NOOP
2011-04-22 08:33:45.450 DEBUG Ftp(2) Info: Data connection closed: System.Net.Sockets.SocketException (0x80004005): 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 Rebex.Net.ProxySocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.AayBuI.KsZBuZ(Byte[] , Int32 , Int32 )
2011-04-22 08:33:45.450 DEBUG Ftp(2) Info: Waiting for data transfer ending message.
2011-04-22 08:33:45.466 DEBUG Ftp(2) Info: Control connection failed, closing current data connection.
2011-04-22 08:33:45.497 ERROR Ftp(2) Info: Error while writing data: 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 wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& , Int32 )
   at wWGvS.AgXIfM.KsZclZ(Int32 )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.cgrDQE(Int32 )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.cgrDQE(Int32 )
   at Rebex.Net.Ftp.AwjivcZ(AoLBks , FtpResponse , String , Int64 , String , Boolean )
   at wWGvS.AayBuI.KsZBuZ(Byte[] , Int32 , Int32 )
   at wWGvS.AayBuI.Write(Byte[] buffer, Int32 offset, Int32 count)
2011-04-22 08:33:45.497 ERROR Ftp(2) 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 wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& , Int32 )
   at wWGvS.AgXIfM.KsZclZ(Int32 )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.cgrDQE(Int32 )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.cgrDQE(Int32 )
   at Rebex.Net.Ftp.AwjivcZ(AoLBks , FtpResponse , String , Int64 , String , Boolean )
   at wWGvS.AayBuI.KsZBuZ(Byte[] , Int32 , Int32 )
   at wWGvS.AayBuI.Write(Byte[] buffer, Int32 offset, Int32 count)
   at wWGvS.bsWOwAZ.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Rebex.Net.Ftp.bGLizE(String , String , Stream , Int64 , Int64 )
I tried transferring the same file to the same server using FileZilla.  I got the following error:
Error:      Disconnected from server: ECONNABORTED - Connection aborted
HOWEVER, the transfer did not stop.  I'm wondering how FileZilla handled that error.  Does anybody have any ideas.  The only thing that I can think to try is the following:
1.  Start transfer
2.  Wait for and catch exception
3.  If exception is of type SocketException do the following:
  a.      Reconnect to the server
    i.      If this fails… go to 4b
  b.      Resume transfer from spot of failure
  c.      Go to 2
4.  If the exception is of any other type
  a.      Disconnect
  b.      Present user with error message