I am running a socket server on a Android 10 TvBox, that has the hotspot mode enabled.
I have noticed that the hotspost mode goes off after around 10 minutes, UNLESS somebody is connected to the server socket.
Unfortunatly the TvBox settings don't have any mean to keep the hotspot alive, like you can do on most phones.
So, the question is how to fake a socket connection to itself and see if this is enough to let the TvBox in hotspot mode.
I did this but it seems not to be enough or something is wrong:
Code: Select all
command chatServerStart
accept connections on port kPort with message "chatServerClientConnected"
send "ServerTimer" to me in 240 seconds --keep hotspot alive
put true into sRunning
end chatServerStart
--keep the hotspot alive -test
Command ServerTimer
put the networkInterfaces into tInterfacesList
set the itemdelimiter to "."
repeat for each line tMyIP in tInterfacesList
if item 1 of tMyIP <> 127 then
exit repeat
end if
end repeat
open datagram socket to tMyIP & ":" & kPort
close socket tMyIP & ":" & kPort
if sRunning then
--Refresh hotspot
send "ServerTimer" to me in 240 seconds
end if
end ServerTimer
Trevix