SSH.NET Peek() hangs - WeOnlyDo Discussion board

SSH.NET Peek() hangs (wodSSH / wodSSH.NET)

by Tony, Wednesday, February 22, 2017, 21:23 (273 days ago)

Hello,

I am using the following function to test for connectivity before using the client to access a remote computer. Connections are stored in a pool until ready to be used. When I run the app at normal speed, the Peek() call hangs. When I run in debug mode, stepping through the code, Peek() appears to execute normally. Can you explain what might be going on here? We just upgraded to v2.6.6 of the client. Previously, we were using v2.5.3 but this did not seem to happen. Have there been any issues with Peek()? Does this seem like a sensible use of the method?

Protocol = SSHAuto
Blocking = true
Timeout = 0

Here is the function that calls Peek():

public override void ProofOfLife()
{
if (m_ssh != null)
{
try
{
if (m_ssh.State != SSH.States.Connected)
{
throw new Exception("ProofOfLife: SSH client is not connected.");
}
m_ssh.Peek(); // hangs here when run at normal speed
}
catch
{
throw;
}
finally
{
}
}
else
{
throw new Exception("ProofOfLife: SSH client is null");
}
}


Complete thread: