So you need to first modify any loop that your users are likely to leave the channel in when not watching so that instead of waiting indefinitely, msg=wait(0,port) it waits just short period, like msg=wait(100,port).
Then you need to set a timer so that your channel checks if it is authorized, every 15 minutes or so, you would create and set the timer before the loop:
timer=createobject("rotimespan")
timer.mark()
then within the loop, when the timer reaches 15 minutes,you check if the channel is authorized, the same way you check when the channel starts:
timer=createobject("rotimespan")
timer.mark()
while true
msg=wait(100,port)
if timer.totalseconds() > 900 then
test=checkauthorization()
timer.mark()
if not test then
?"not authorized, exiting"
end
end if
end if
Depending on what the output of your authorization test is, you may need to modify this a bit, for example, if the returned value is a number and not a boolean true/false.
- Joel