CPU usage with ssh.blocking = true - WeOnlyDo Discussion board

CPU usage with ssh.blocking = true (wodSSH / wodSSH.NET)

by wodSupport, Saturday, April 12, 2014, 01:07 (2239 days ago) @ Marc M


hi. Not sure why you get high CPU utilization, but you can always make your own WatiFor which is quite simple actually. Define one global variable:

Global String InData

and then in DataReceived event add this:

InData = InData + SSh1.Receive
if (instr(InData, "your_prompt")) then
"prompt found", remove all up to found data....
do nothing.. wait for more data

so basically you append to your own string until your string is found among all received data. When it's found - do with it whatever you want, clear InData buffer, continue with coding, etc..

This way you can have multiple InStr calls, and have much more control than with our WaitFor.

Would that help?


Complete thread: