PDA

View Full Version : WinINet and firewall denials issue


TheMysteriousStranger
05-22-2006, 06:46 AM
For those using wininet, how are you handling the user denying internet access to your game via the firewall?

At the moment, I have it set up so that the attempt to access the net is only done when the user clicks to submit a high score or view the online scoreboard. The problem is, that if the user clicks to deny the access via a firewall, the game hangs completely until windows decides the connection has timed out (which on my machine is 30 seconds, but I think the default is 60 seconds). Obviously, I'd rather it didn't hang like this.

My first thought was asynchronous mode for wininet, but for some bizarre reason that I can't fathom, when I use async mode, the calls to open the internet connection work normally, but any calls to open a specific url fail.

So I'm wondering if there's some trick that I've missed that will allow the game to continue processing while wininet is busy timing out.

luggage
05-22-2006, 07:24 AM
I put it on another thread and set my own time out for it. This would let you have a nice, smooth busy anim and if it doesn't return in what you think is a reasonable time to just bail out and say they're not available.

TheMysteriousStranger
05-22-2006, 07:30 AM
Now I feel stupid for not thinking of the obvious solution myself :) Thanks luggage. Have a hundred tiny foot spas :)

TheMysteriousStranger
05-23-2006, 04:12 AM
Well...I have wininet in a thread - but this has produced a very strange problem, and I'm hoping someone else has seen this and knows the solution - becasue I've been fighting with it for about eight hours now and I'm about ready to go postal...

When wininet is run in it's own thread, the call to open the URL delays for about 20 seconds before actually doing anything. I know this because there's a 20 second delay between the call to InternetOpenURL and the zonealarm warning dialog popping up. This would be really annoying for the end user as most would probably hit the cancel button before the 20 seconds are up.

I have absolutely no idea what is causing this. If I run the exact same wininet code in the main app thread, it works instantly. It's a very weird problem...