Home Forums .NET libraries Xceed SFTP/FTP for .NET Disconnect error

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

    Hi all,

    After I transfer my file successfully and when I try to disconnect, I get this:
    Xceed.Ftp.FtpIOException: An I/O error occurred while sending a command. —> System.Net.Sockets.SocketException: An existing co
    nnection was forcibly closed by the remote host

    My code:

    http://ftp.SendFile(flName, flName);
    http://ftp.Disconnect();
    http://ftp.CommandSent -= new CommandSentEventHandler(this.FTP_CommandSent);
    http://ftp.ReplyReceived -= new ReplyReceivedEventHandler(this.FTP_ReplyReceived);

    Help …

    Steve

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

    User (Old forums)
    Member
    Post count: 23064

    I’ve got exact the same problem. I’m also getting this error when trying to disconnect after a send file.

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

    User (Old forums)
    Member
    Post count: 23064

    When you disconnect, both the server and client will attempt to disconnect at the same time. Sometimes the server wins the race and the socket is closed before the client expected it.
    Best way to deal with it is to wrap the .Disconnect() in a Try/Catch statement and ignore the thrown exception.

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

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