Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » How to check internet availability?
Re: How to check internet availability? [message #44159 is a reply to message #44158] Sun, 11 January 2015 14:48 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Hello Luigi,

The easiest workaround that comes to my mind is trying to connect to a known network or host (such as google) and grabbing the socket errors if any.
İf a socket error occurs, simply check the errno for error number: ENETUNREACH on Linux, and WSAGetLastError() for WSAEHOSTUNREACH on Windows.

On windows, there are also InternetGetConnectedState() and InternetCheckConnection() functions, from Windows 2000 and on.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa38 4702%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/aa38 4346%28v=vs.85%29.aspx

Regards,
Oblivion


[Updated on: Sun, 11 January 2015 14:58]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Print unwanted copy
Next Topic: Context Menu request
Goto Forum:
  


Current Time: Fri Apr 26 01:46:13 CEST 2024

Total time taken to generate the page: 0.05444 seconds