I use a trial version. I am facing an issue when I call the _ftp.ChangeDirectory() method on remote server. I thought the passive mode but this does not solve the problem. I note that this error is not systematic, it sometimes occurs.

Here is the log:

07/05/2011 - 10:29:41.112 [1] ... An error orccured on ChangeDirectory. Error : An established connection was aborted by the software in your host machine. -
   at Rebex.Net.Ftp.BQDrolZ(String , String )
   at Rebex.Net.Ftp.CnNcvYZ(String )
   at Rebex.Net.Ftp.ChangeDirectory(String remotePath)

.....

10:43:52.794 Error Info: Rebex.Net.FtpException: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   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.AgXIfM.ByklbC(Byte[] )
   at Rebex.Net.Ftp.BQDrolZ(String , String )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.BQDrolZ(String , String )
   at Rebex.Net.Ftp.CnNcvYZ(String )
10:43:52.794 Error Info: System.InvalidOperationException: Not connected to the server.
   at Rebex.Net.Ftp.cOUusW()
   at Rebex.Net.Ftp.GetList(String arguments)93

93

asked 05 Jul '11, 11:10

PECTO's gravatar image

PECTO
15
accept rate: 0%

edited 05 Jul '11, 11:18

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28


This looks like the error occurred while trying to send the CWD (ChangeDirectory) command to the FTP server. The error message seems to indicate that the connection was disconnected locally, but unfortunately these socket exceptions are often misleading. Perhaps you left the connection idle for several minutes and the server disconnected you? Or does this happen out-of suddent? A log snippet that includes few commands preceding the failed one might help shed some light on this.

(Active/passive mode did make any difference in case of GetList because the error occurred before the data connection was established.)

link

answered 05 Jul '11, 11:27

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

My Application Monitors folders every XX minutes. To deal with problem you mentioned "Perhaps you left the connection idle for several minutes and the server disconnected you?" Each time I create a new instance of FTP. I initialize it. It seems to work now.

(05 Jul '11, 11:37) PECTO

That looks like the best solution. An alternative would be to call KeepAlive method every minute or so, but that would be more complicted and some FTP servers are even known to ignore these keep-alive attempts.

(05 Jul '11, 12:19) Lukas Pokorny ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×152
×13

Asked: 05 Jul '11, 11:10

Seen: 488 times

Last updated: 05 Jul '11, 12:19