-
-
Notifications
You must be signed in to change notification settings - Fork 970
Description
When a server sends a SSH_MSG_DISCONNECT and the client invokes Disconnect() or Dispose() at the same time, this can lead to one of following exceptions (from issue #58):
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.get_Available()
at Renci.SshNet.Session.IsSocketConnected(Boolean& isConnected)
at Renci.SshNet.Session.get_IsConnected()
at Renci.SshNet.Session.SendDisconnect(DisconnectReason reasonCode, String message)
at Renci.SshNet.Session.Disconnect(DisconnectReason reason, String message)
at Renci.SshNet.Session.Disconnect()
at Renci.SshNet.BaseClient.Disconnect()
at DBAService.Logic.FileTransfer.DbaSftpClient.CloseConnection() at System.Net.Sockets.Socket.get_Available()
at Renci.SshNet.Session.IsSocketConnected(Boolean& isConnected)
at Renci.SshNet.Session.get_IsConnected()
at Renci.SshNet.Session.SendDisconnect(DisconnectReason reasonCode, String message)
at Renci.SshNet.Session.Disconnect(DisconnectReason reason, String message)
at Renci.SshNet.Session.Disconnect()
at Renci.SshNet.BaseClient.Disconnect()
at DBAService.Logic.FileTransfer.DbaSftpClient.CloseConnection()
or
System.NullReferenceException: Object reference not set to an instance of an object.
at Renci.SshNet.Session.IsSocketConnected(Boolean& isConnected)
at Renci.SshNet.Session.get_IsConnected()
at Renci.SshNet.Session.SendDisconnect(DisconnectReason reasonCode, String message)
at Renci.SshNet.Session.Disconnect(DisconnectReason reason, String message)
at Renci.SshNet.Session.Disconnect()
at Renci.SshNet.BaseClient.Disconnect()
at DBAService.Logic.FileTransfer.DbaSftpClient.CloseConnection() at Renci.SshNet.Session.IsSocketConnected(Boolean& isConnected)
at Renci.SshNet.Session.get_IsConnected()
at Renci.SshNet.Session.SendDisconnect(DisconnectReason reasonCode, String message)
at Renci.SshNet.Session.Disconnect(DisconnectReason reason, String message)
at Renci.SshNet.Session.Disconnect()
at Renci.SshNet.BaseClient.Disconnect()
at DBAService.Logic.FileTransfer.DbaSftpClient.CloseConnection()