17.07.2024, 10:44
Thank you for your reply!
OK.....I guess it is because the resident script runs lutron_login() every time?
Does this code look better?
OK.....I guess it is because the resident script runs lutron_login() every time?
Does this code look better?
Code:
require('user.lutron')
require('socket')
if not server then
server = socket.udp()
server:setsockname('127.0.0.1', 5485)
--server:settimeout(3)
end
data = server:receive()
if data then
if not tcp then
tcp, err = lutron_login()
if tcp == nil then
grp.checkwrite('10/0/2', true)
else
tcp:send(data)
os.sleep(0.3)
end
end
end