I already have a working tcp script in resident script but i want to make it more economical on cpu etc,
i am communicating to alarm panel so i want to receive pir triggered events etc
Do you have some extra communication in the script? You won't get any improvements on CPU usage if you're only reading from TCP and updating object values.
22.09.2020, 05:27 (This post was last modified: 22.09.2020, 20:25 by benanderson_475.)
(21.09.2020, 07:24)admin Wrote: Do you have some extra communication in the script? You won't get any improvements on CPU usage if you're only reading from TCP and updating object values.
What is the best way to achieve what i need?
Below is what i currently have in resident script, i need to log out and log in every 15 min to maintain connectivity, and also have object event script sending to udp server in this script to send the client:write() to alarm to activate outputs, i was thinking as i currently use mqtt with https://forum.logicmachine.net/showthread.php?tid=2670 i can utilize the local bus in the event loop without the need to have an additional event script as well as having the on_timer function in the above link running the login/out function every 900 sec.
Thanks for this, this is what i am after although after a short amount of time it stops reading, i don't get any error in the log, so i insert
log( _, sstat, cstat) after _, sstat, cstat = socket.selectfds(10, sfd, cfd)
when arg 1 is nill, after this i don't receive any command from the client:receive() until i stop and start the script etc
see attached log screenshot