Using Execute/Receive method when CMD returns larg - WeOnlyDo Discussion board

Using Execute/Receive method when CMD returns larg (General questions)

by Sunny, Friday, December 05, 2008, 21:57 (5831 days ago)

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

by wodDamir, Friday, December 05, 2008, 22:03 (5831 days ago) @ Sunny

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

by Sunnny, Wednesday, December 10, 2008, 17:18 (5826 days ago) @ wodDamir

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

by woddrazen, Wednesday, December 10, 2008, 17:29 (5826 days ago) @ Sunnny

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