Jump to content
  • Advertisement
Sign in to follow this  
da_cobra

checking if there is an internet connection?

This topic is 4970 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Ask the user. If they connect through dialup, they may not be connected currently but may want to, and in any case may have very particular ideas regarding whether they want your program accessing the internet or not.

Share this post


Link to post
Share on other sites
I'm making an application that needs to open a certain website. So can't I just check myself if there is an internet connection or not? If not I can warn the user that I will not be able to connect to that website?

Share this post


Link to post
Share on other sites
Again: just ask the user. That way, he'll either know that your program is accessing a website, or be able to decide that it shouldn't.

If the access is caused by a user's explicit action and should be obvious (like if the user selected "Open MyProgram home page..." from the help menu) then you can reasonably assume that the user wants you to make a connection and that you are able to. Otherwise, ask.

Share this post


Link to post
Share on other sites
There appear to be Windows functions to do this sort of stuff. Check out InternetCheckConnection to determine if you can connect to a website. Or you can try creating a socket and connecting manually, but this is probably simpler. There's also InternetGetConnectedState to determine the Internet connection state, as well as functions to connect via dialup. The documentation seems light on details, though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!