Thank you so so much!
It works and I don't see the send delay anymore.... internal socket does not get stuck also.
I guess I am opening TCP port each time I run this resident script as well ?
I tried to edit them like you did but I am failing....could you suggest how to modify it to have only a single open connection?
By the way in this project we have iOS tablet app and phone app but the frontend does not have functionality to prevent user from continuously clicking on the command button.
That is why I put os.sleep(0.3) every time after sending TCP command but do you have better way to prevent high load caused by users' over-clicking ?
Thank you very much for your help as always!
It works and I don't see the send delay anymore.... internal socket does not get stuck also.
I guess I am opening TCP port each time I run this resident script as well ?
I tried to edit them like you did but I am failing....could you suggest how to modify it to have only a single open connection?
Code:
require('user.lutron')
tcp, err = lutron_login()
if not tcp then
log('no connection to device', err)
end
while tcp do
res, err = lutron_receive(tcp)
log(res,err)
if (res == nil) then
return
end
end
By the way in this project we have iOS tablet app and phone app but the frontend does not have functionality to prevent user from continuously clicking on the command button.
That is why I put os.sleep(0.3) every time after sending TCP command but do you have better way to prevent high load caused by users' over-clicking ?
Thank you very much for your help as always!