Problem with remote host - WeOnlyDo Discussion board

Problem with remote host (wodSSH / wodSSH.NET)

by Helmut Schnur, Friday, July 22, 2005, 08:49 (6856 days ago)

I have a strange problem with a remote host closing connection sometimes. I'm using the following code:

try
{
SSH ssh = new SSH();
ssh.Hostname = hostname ;
ssh.Login = user ;
ssh.Password = password ;
ssh.TerminalType = tty ;
ssh.Blocking = true;
ssh.Timeout = 0;

ssh.Command = ls -la;echo XXX
;
ssh.Connect();
string data = ssh.WaitFor( XXX );
Trace(data);
}
catch (Exception exc)
{
Trace(exc.Message);
}

Doing this sometimes it works, sometimes I immediately get the exception Remote host has closed the connection . What I'm doing wrong?

Kind regards,
Helmut


Complete thread: