Actually I might be wrong, but I believe this does check to see if internet connectivity exists (as well as LAN). See the documentation remarks. But mind you MS’s wording across the entire article is very confusing between LAN and the Internet. Also it appears that this call is deprecated and we all should probably move over to INetworkListManager.
I disagree with just trying the request. Going back to Apple and iOS, I believe why they were mandating checking for the network before using it, boiled down to the user experience. There’s often lengthy timeouts involved, especially if you’re on a crappy network. This reflects poorly not just on the app, but at the time iOS which in the early days didn’t have the most resilient or robust cellular connectivity.
Maybe I’ve spent too much time on the other side in Apple-land (Xcode, Obj-C, Swift, etc.), but I sort of see this as taking a trip to the mountains in the winter. Ideally one would check for road closures and issues along the way before hopping in the car and hoping for the best. The entire premise here on the network side is to check for a good likelihood for success before actually trying the connection.
The dilemma here is that there’s no right answers on the connection. If you keep normal connection timeouts, a user could be waiting 60 seconds before things fail. And if you shorten this down to make things fail faster, then those on crappy network connections will fail to make the connection even though they are capable given enough time.
I think the problem here is that LookupIPAddress, from what I can tell from the docs, is just a DNS lookup and has nothing to do with actually checking the path from the client to the FQDN. Theoretically one could bake in a traceroute to check themselves, but you’ll end up in the same bucket as the connection timeout issue (e.g. adjusting timeouts, needing to handle say a switch dropping some but not all packets, making the connection problematic but still traversable, etc.).
Yes, this is very doable but would need to be done strategically and as part of a larger and more wholistic solution.
See my comments above. Ultimately and not to be an Apple weenie here, but how Apple does this with Reachability and others with subsequent technologies, is exactly what I’d like to see across all OSes within Xojo.
Here’s where the rubber meets the road within my own code. In my Apple target, I’m rest assured that someone is on a network, on the Internet and can see my server before making any network calls. How Apple does this has never been detailed as they’ve never released their implementation details and hence it’s always been a blackbox that has just worked. But under Windows, I can only determine if they’re on a network and the Internet, not whether or not they’re traversable to my server or even if my server is even up before making the call.
I’m not disagreeing that the pieces aren’t already out there and I’m more than capable to craft some solutions here myself, but it’s low on my own priority list versus other things. But as this is something that impacts by and large all Xojo users who use the network, that’s why I called out an enterprising plugin vendor although Xojo could do this themselves if they didn’t already have so much on their plate.
Not that I’m fond of blackboxes, but frankly that’s what I’m advocating for here. Some high level wrapper or class that hides all the nuances and intricacies we’ve been talking about this thread where a Xojo developer can be rest assured that the results will be the same regardless of the platform they’re targeting.