Home Forums .NET libraries Xceed SFTP/FTP for .NET Unexpected State Error

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

    I just started using your FTP control and there seems to be a pause on the server that I’m connected to when I disconnect. I get an unexpected state error and handle it, but I was wondering if that was expected behaviour?

    Thanks

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

    User (Old forums)
    Member
    Post count: 23064

    Hi!

    This is normal behavior with version 1.0. At disconnection, an “unexpected state” exception may occur while both sides are racing for disconnection.

    The FtpClient instance sends “QUIT” to the server, then tries to disconnect the socket. But it can happen that the FTP server has time to receive the “QUIT” command and disconnect its own socket before we do. Then we get an exception disconnecting our own socket.

    In upcoming version 2.0, the Disconnect method does not throw an invalid state exception in this case. With version 1.0, it is safe to catch any exception thrown by Disconnect.

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

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