Hi,
I would like to share this algorithm and if it is possible to receive your feedback (thanks in advance).
I’ve tried it and it seems to work fine.
Regards,
Solca
-- -- Test to know if a server is online, without using sockets -- local AccessPoint = "https://subdomain.domain.com:port" -- Server URL (includes protocol and port) local timeOutTest = 3 -- seconds for timeout in network.request local online2 local function testPlatform( ) local function testPlatformInternal( event ) if (event.isError) then online2 = false else online2 = true end end local headers = {} local params = {} params.headers = headers params.timeout = timeOutTest network.request(AccessPoint,"GET",testPlatformInternal, params) end testPlatform () local function myWait( ... ) if ( online2 == true ) then print ("Plataform is ONLINE :) ") elseif ( online2 == false) then print ("Plataform is OFFLINE :(") else print ("PLATFORM IS UNDEFINED ??") end end local timeWait = timeOutTest \* 1000 + 200 -- timeout + 200 msec timer.performWithDelay( timeWait, myWait )