Suppressing a not-connected exception on socket shutdown #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm trying out SshNet on an ARM device with a very old linux kernel (2.6.29) and old version of mono (3.0.11). I'm not sure if this is a function of my ancient environment.
While closing a socket associated with ChannelDirectTcpip, the _socket seems to respond true to
_socket.Connected
; but throwsSocketException: The socket is not connected
when it hits_socket.Shutdown()
. Since it's a shutdown procedure anyway, I assume this exception is not important so I just send it to the log and escape out.I ran some limited tests and by suppressing this exception, SshNet no longer bombs out and instead continues to be available and seems to continue humming along without any other apparent issues. I have not checked if there's other sockets which also have an untrustworthy Connected property.