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 (1317 days ago) @ Marc M

Marc,

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....
else
do nothing.. wait for more data
endif

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?

Kreso


Complete thread: