Re: Timeout occurred due to inactivity when I exec - WeOnlyDo Discussion board

Re: Timeout occurred due to inactivity when I exec (General questions)

by woddrazen, Tuesday, March 17, 2009, 09:00 (5490 days ago) @ sajjad

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.html

Let us know how it goes.


Regards,
Drazen


Complete thread: