I have found the following 2 errors.
The first may just be an issue with terminology.
GetInternetState()
Returns 1 if the device is connected to the internet, 0 if not.
This command returns 1 if you are connected to a network. If the network is not connected to the internet, you still get 1.
SetHTTPTimeout
Doesn't do anything. Timeout remains at 30 seconds.
The code below sets the timeout to 5 seconds. The demo page it is querying will not return anything for 10 seconds. At 5 seconds AppGameKit should time out. It actually gets the return flag of -1 at 10 seconds when the page times out on the web server.
// display a background
w = 1280
h = 720
SetWindowSize( w, h, 0 )
SetVirtualResolution( w, h )
http = CreateHTTPConnection()
SetHTTPTimeout(http, 5000)
SetHTTPHost(http,"www.devink.co.uk",0)
SendHTTPRequestASync(http, "games/nothing.php")
counterStart# = timer()
do
print ("Looking for a connection")
print(str((timer() - counterStart#),1))
if GetHTTPResponseReady(http) = 0
print("Waiting....")
else
print("Final Time : " + str((timer() - counterStart#),1) + " Seconds")
endif
print("Result will be -1 if it gives up : " + str(GetHTTPResponseReady(http)))
// update the screen
Sync ( )
loop