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.
Code Block
 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?

How to check if internet is avaiable on mac os?

I’m responding to this question over in the other thread you created for it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
How to check if internet is avaiable on mac os?
 
 
Q