Re: Timeout occurred due to inactivity when I exec (General questions)
Hi,
I am still unable to execute the command. I made changes in code as per according to your suggestion but it doesn't work. My application halt at 'waitfor' condition.
Following is my code:
private void button3_Click(object sender, EventArgs e)
{
Ssh1.Login = TextBox3.Text;
Ssh1.Password = TextBox4.Text;
Ssh1.Encryption = WeOnlyDo.Client.SSH.EncryptionMethods.Auto;
Ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
Ssh1.Port = 22;
Ssh1.Blocking = true;
Ssh1.Timeout = 40;
Ssh1.Connect(TextBox2.Text);
Ssh1.WaitFor(@ regex:[$ #>] $ );
Ssh1.Execute( cd /tmp
, @ regex:[$ #>]$ );
}
I tried many other option as it is mentioned in the help manual, but it do not work.. :(
Hi Sajjad,
Can you please move your code from Connected Event just after Connect Method. You are using blocking mode and commands are executed line by line so you don't need Events.Also please remove Prompt Property because you don't need it if you are using WaitFor Method.
If you still receive error on WaitFor line please change it to this:
[code]Ssh1.WaitFor( regex:[\$ #>] $ )[/code]
When using Execute Method you should add second prompt parameter also and send (
or
) sequence at the end of your command.Something like this:
[code]Console.Write(Ssh1.Execute( cd /tmp
, regex:[\$ #>]$ ));[/code]
More help fro Execute Method you can find here:
http://www.weonlydo.com/SSH.NET/Help/WeOnlyDo.Client.SSH.Execute_overload_2.htmlLet us know how it goes.
Regards,
Drazen
Complete thread:
- Timeout occurred due to inactivity when I execute - sajjad, 2009-03-17, 07:55
- Re: Timeout occurred due to inactivity when I exec - woddrazen, 2009-03-17, 09:00
- Re: Timeout occurred due to inactivity when I exec - sajjad, 2009-03-20, 08:24
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-20, 08:41
- Re: Timeout occurred due to inactivity when I exec - sajjad, 2009-03-20, 08:56
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-20, 09:18
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-20, 10:51
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-24, 10:09
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-20, 10:51
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-20, 09:18
- Re: Timeout occurred due to inactivity when I exec - sajjad, 2009-03-20, 08:56
- Re: Timeout occurred due to inactivity when I exec - wodDamir, 2009-03-20, 08:41
- Re: Timeout occurred due to inactivity when I exec - sajjad, 2009-03-20, 08:24
- Re: Timeout occurred due to inactivity when I exec - woddrazen, 2009-03-17, 09:00