Checking online for current version
BlitzMax Forums/BlitzMax Programming/Checking online for current version
| ||
I want my game to check an online file to see if it is the current version. I was intending to do this with a simple ReadFile(http::) but noticed that if the site is down the game hangs waiting for the file. Is there any way to timeout if the file cannot be found? Or is there perhaps a more efficient way of doing this? |
| ||
local success=readfile(blahblahblah) if success then do something else don't do something end if or you might look at try..catch blocks Cheers Charlie |
| ||
Check Brucey's libcurl module. I think the setting you are looking for is CURLOPT_TIMEOUT but I'm not sure since it's a while since I've been there. |
| ||
the setting you are looking for is CURLOPT_TIMEOUT Or you can do an asynchronous call, which won't block - instead you "poll" the connection for data. You can also apply the timeout setting to it. |