Home Forums .NET libraries Xceed SFTP/FTP for .NET FtpIOException: reading from or writing to the data channel

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20662 |

    Hi,

    I am currently testing out the Xceed.Ftp component in a windows form.
    The app uploads files found in one local directory to a remote server, every x minutes.

    I am getting an error of which i can’t find out where or why the actual source lies.
    I get this error not each time i start an ftp session. It happens 1 out of 3 or 4 times. Sometimes the first batch, sometimes later on. It always happens after the first number of files has been uploaded. Lets say the code manages to put 3 to 6 files, then generates the error.

    This is the error:

    Xceed.Ftp.FtpIOException: An error occurred while reading from or writing to the data channel. —> System.IO.IOException: I/O error occurred.
    at Xceed.Utils.Security.Ssl.SecureNetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
    at Xceed.Ftp.Engine.FtpDataConsumerCommand.ReadCompleted(IAsyncResult result)
    — End of inner exception stack trace —

    This is the code within the try{}catch{} block that throws the exception.

    <i>
    result = ftpClient.BeginSendFile(file.FullName,remoteFilename,null,null);
    while(!result.IsCompleted)
    {
    Application.DoEvents();
    }

    ftpClient.EndSendFile(result);
    </i>

    I could of course do nothing in the catch block, but i am logging all errors that happen in the app, so i need the catch block and i need to throw the exception there.

    thanks in advance,
    v

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by panik (had 4998 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    i know it is pure evil to reply to one’s own posts. But i found something additional.
    Together with the error described above (which is being logged), i get this error at the exact same moment:

    An unhandled exception of type ‘System.ObjectDisposedException’ occurred in mscorlib.dll

    Additional information: Cannot access a disposed object.

    I always thought both were not related, untill i just tested out the ClientFTP sample application. Which gives me the exact same error as described in this post.

    hope this adds more info.

    cheers,
    v

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by panik (had 414 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    I have closed down on where the error exactly happens.
    I am now working with an AsyncCallback that is called when the operation completes.

    <i>
    ftpClient.BeginSendFile(file.FullName,remoteFilename,false,new AsyncCallback(SendFileCompleted),index);
    </i>

    and further on

    <i>
    private void SendFileCompleted(IAsyncResult asyncResult)
    {
    (…)
    </i>

    The ObjectDisposedException is thrown right in between those two. I logged when the BeginSendFile method is called and when the SendFileCompleted is being called. The exception is thrown before the SendFileCompleted is being called and after the BeginSendFile is called.

    It happens about 3 out of 4 times. I tested with several files, and with different number of files, but the error keeps occuring.

    any ideas? This is a very anoying bug, and if i can’t get this working, i will have to look at a different FTP component.

    greetings,
    v

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by panik (had 358 views)

    User (Old forums)
    Member
    Post count: 23064

    I don’t really have solution for your problem.
    I just want to tell you that this forum is not really meant for official technical support, only for discussions between users of Xceed products.
    I think it’s ok to ask questions here, because often someone else has had the same problem before and can answer. If no-one replies, it’s best to send the problem directly to Xceed Support.

    Support Form: <a href=”http://www.xceedsoft.com/support/form.asp”>http://www.xceedsoft.com/support/form.asp</a&gt;.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Tommy (had 271 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you for pointing this out to me. As a trial user, I was convinced the forum was the only way to eventually get any insights on the problems I am enountering.

    cheers,
    v

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by panik (had 5221 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.