while using Renci SSH Client successfully in production, I noticed a really rare error that just occurred on my dev machine:
```
4491 - OXE Control Center Gui: 15:08:15.9481613 - [Remote Connector] 10.132.142.192: Detected stop flag, terminating remote connection...
2482 - OXE Control Center Gui: 15:08:16.0824215 - [Remote Connector] 10.132.142.192: Error on connection check!
Source: Renci.SshNet
Message:
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei Renci.SshNet.Session.IsSocketConnected(Boolean& isConnected)
bei Renci.SshNet.Session.get_IsConnected()
bei Renci.SshNet.BaseClient.get_IsConnected()
bei NextiraOne.Processors.RemoteConnector.IsConnected() in C:\Users\nsk\Documents\Visual Studio 2010\Projects\9 - NextiraOne Libraries\NextiraOne.Core\SP_RemoteConnector.cs:Zeile 393.
```
Notice my generic log message prefixes from my wrapper class around Renci.SshNet that tells us what happened here and in what short timeframe this occurs:
My program execution was stopped due to the internal stop flag and immediately after that the connection state was checked (don't think about the use case as I have a complicated multithreaded environment in which this check may be optimized/blocked at this stop situation, but this is a different topic :D )
The excpected result from IsConnected() is false here.
This is not severe, as my connection check treats errors equal to false. But just to improve Renci.SshNet I post this case here. :)
"Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt." means in english kind of "The object reference does not point to an object".
Regards,
Nicolas
Comments: ** Comment from web user: nsk7even **
Hi Oleg,
I just compiled revision 22733 and let my application run with this one for a while...
But I doubt to get the error again since I never saw it before (and I am actively developing at other parts of my application which always needs the ssh connection).
What I wanna say is that I assume the timeframe is really short in which I have to call the connected state after sending the disconnect command to provoke the above exception.
My platform is .NET 4.0 on an x64 machine, using AnyCPU profile in debug mode.
I just checked my lab system where my app is installed as windows service in release mode and there the above error never occurred. I am sorry to not being able to check the production system as I have to request the access for it with reason...
Regards,
Nicolas