Post

Replies

Boosts

Views

Activity

How to check if internet is avaiable on mac os?
I'm using c++ in qt. And I need to check if internet is available. For Windows, I used win32 API. INetworkListManager::Get_IsConnectedToInternet. But for Mac, I don't know how. And I don't want a way to ping to a server like google.com. I found "Reachability", but I don't know how to use it in QT. And I briefly looked at sample of Reachability, it seems to ping to the server.  Reachability * reach = [Reachability reachabilityWithHostname:@"www.google.com"];       reach.reachableBlock = ^(Reachability * reachability)   {     dispatch_async(dispatch_get_main_queue(), ^{       _blockLabel.stringValue = @"Block Says Reachable";     });   };       reach.unreachableBlock = ^(Reachability * reachability)   {     dispatch_async(dispatch_get_main_queue(), ^{       _blockLabel.stringValue = @"Block Says Unreachable";     });   }; How can I check if Internet is available?
1
0
971
Sep ’20