Re: Reusing connections for multiple commands (General questions)
When I try that sample code (adapted), I get an exception calling Connect() that the Prompt field is not set. It's sort of a chicken-and-egg problem, where it's not always possible to know what the prompt will be unless you set it yourself.
_ssh = new WeOnlyDo.Client.SSH();
_ssh.Hostname = _host;
_ssh.Login = _user;
_ssh.Password = _password;
_ssh.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
_ssh.TerminalType = tty ;
_ssh.Blocking = true;
_ssh.LicenseKey = xxxxxx ;
_ssh.Connect();
Hi,
Yes, you can send multiple command in non blocking mode using PromptReceived Event.Here is example:
http://www.weonlydo.com/code.asp?did=Send-multiple-commands-to-SSH-server-using-asynchronous-connectionif you prefer to use blocking mode, then you can use WaitFor and Execute Method to send multiple command.
Here is blocking sample:
http://www.weonlydo.com/code.asp?did=Send-multiple-commands-to-SSH-server-using-synchronous-connectionLet us know how it goes.
Regards,
Drazen
Complete thread:
- Reusing connections for multiple commands - jdlogicman, 2011-04-06, 01:24
- Re: Reusing connections for multiple commands - woddrazen, 2011-04-06, 09:11
- Re: Reusing connections for multiple commands - jdlogicman, 2011-04-06, 18:39
- Re: Reusing connections for multiple commands - wodDamir, 2011-04-06, 18:48
- Re: Reusing connections for multiple commands - jdlogicman, 2011-04-06, 21:01
- Re: Reusing connections for multiple commands - wodDamir, 2011-04-06, 21:15
- Re: Reusing connections for multiple commands - jdlogicman, 2011-04-06, 22:19
- Re: Reusing connections for multiple commands - wodDamir, 2011-04-06, 22:22
- Re: Reusing connections for multiple commands - jdlogicman, 2011-04-06, 22:19
- Re: Reusing connections for multiple commands - wodDamir, 2011-04-06, 21:15
- Re: Reusing connections for multiple commands - jdlogicman, 2011-04-06, 21:01
- Re: Reusing connections for multiple commands - wodDamir, 2011-04-06, 18:48
- Re: Reusing connections for multiple commands - jdlogicman, 2011-04-06, 18:39
- Re: Reusing connections for multiple commands - woddrazen, 2011-04-06, 09:11