I've created a SignalR SSH web console and I'm trying to run simple commands like "?" but I do not get a response, just an empty string. Here is a code sample:
SshClient client;
if (!SshClients.TryGetValue(connectionId, out client))
{
Clients.All.receive("ERROR: connection object not found");
return;
}
if (!client.IsConnected)
client.Connect();
var sshCommand = client.CreateCommand(command);
var asynch = sshCommand.BeginExecute();
var reader = new StreamReader(sshCommand.OutputStream);
while (!asynch.IsCompleted)
{
var result = reader.ReadToEnd();
if (string.IsNullOrEmpty(result))
continue;
Clients.All.receive(result);
}
sshCommand.EndExecute(asynch);