Using Execute/Receive method when CMD returns larg (General questions)
Hello,
I am running a command which returns about 8,000 lines. If I use the execute commad I receive a timeout error. If I use the receive method and loop throught until I find the prompt I get what entire result. I have been using Execute for my other stuff and it works fine. So is this an issue with Execute command or am I doing something wrong?
Using Execute
response = Ssh1.Execute(cmd +
, $ , 100);
Using Receive Method
Ssh1.Send(cmd+
);
bool continueReading = true;
while (continueReading)
{
response += Ssh1.Receive();
if (response.IndexOf( $ ) != -1)
{
continueReading = false;
}
}
Thanks,
Sunny
Re: Using Execute/Receive method when CMD returns
Hi Sunny,
What component are you using? wodSSH ActiveX or wodSSH.Net?
Also, can you please try setting global timeout value to a higher value, as well as try with KeepAlives property?
What happens if you try Execute on some other command (with smaller response)? Does it also timeout, or does it execute correctly?
It's a possibility that the prompt you specified really isn't received, so the component will wait until Timeout occurs.
Regards,
Damba
Re: Using Execute/Receive method when CMD returns
I am using wodSSH.Net
I tried setting keepalives to a higher number but its still timing out.
Execute works fine on smaller commands.
Hi Sunny,
What component are you using? wodSSH ActiveX or wodSSH.Net?
Also, can you please try setting global timeout value to a higher value, as well as try with KeepAlives property?
What happens if you try Execute on some other command (with smaller response)? Does it also timeout, or does it execute correctly?
It's a possibility that the prompt you specified really isn't received, so the component will wait until Timeout occurs.
Regards,
Damba
Re: Using Execute/Receive method when CMD returns
Hi Sunny,
Please set Timeout Property to 0
[code]SSh1.Timeout = 0;[/code]
Also please remove timeout value from Execute Method ( and other lines if you use it).
[code]response = Ssh1.Execute(cmd + \r\n , $ );[/code]
Let us know how it goes.
Drazen