If written some threaded code that makes use of this library. A simplified version of my code looks like this:
I know that ShellStream has a way of setting a write timeout, but I get a "this stream does not support timeouts" message if I try that.
I've debugged using the SSH.Net code, and I see that an SshConnectionException is thrown, and objects start trying to Dispose. The point at which it gets stuck is in Session.cs, at line 673: "_messageListenerCompleted.WaitOne();"
Is there a solution to this?
while (!stopThread)
{
if ([there is new input])
{
ShellStream.WriteLine(newInput);
output = ShellStream.Expect(regex prompt, timeout);
AddOutputToOutputQueue(output);
}
}
During testing, I've discovered that if I establish a connection, then disconnect my network cable (because network dropouts are a real possibility for the application I'm making), this code hangs indefinitely at the ShellStream.WriteLine method. At always straight away, I'll sometimes get a couple of null outputs first, but eventually it just hangs.I know that ShellStream has a way of setting a write timeout, but I get a "this stream does not support timeouts" message if I try that.
I've debugged using the SSH.Net code, and I see that an SshConnectionException is thrown, and objects start trying to Dispose. The point at which it gets stuck is in Session.cs, at line 673: "_messageListenerCompleted.WaitOne();"
Is there a solution to this?