I am using c++ in QT.
And I want to check network connection on mac os without ping to server(like "google.com").
How can I do it?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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?