You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
The text was updated successfully, but these errors were encountered:
drieseng
changed the title
Race condition when server closes session
Race condition when disconnects
Sep 4, 2016
drieseng
changed the title
Race condition when disconnects
Race condition when both server and client disconnect
Sep 4, 2016
Introduce dispose lock to resolve race condition in IsConnected/IsSocketConnected.
Rename _socketLock to _socketWriteLock
Eliminate extra allocations in ReceiveMessage, and combine two socket reads.
Use separate lock to eliminate race condition in IsSocketConnected between Poll and checking the Available property.
Modify SocketRead(int length, byte[] buffer) to also take offset.
Modify MessageListener to use Select instead of blocking Receive.
Fixes issue #80.
When a server sends a SSH_MSG_DISCONNECT and the client invokes
Disconnect()
orDispose()
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()
The text was updated successfully, but these errors were encountered: