mirror of
https://github.com/textmate/textmate.git
synced 2026-01-23 05:37:55 -05:00
Since we now require 10.7 we don’t need all of this. Keeping it around is just noise that can lead to confusion about code paths.
21 lines
432 B
C++
21 lines
432 B
C++
#include "network.h"
|
|
|
|
namespace network
|
|
{
|
|
bool can_reach_host (char const* host)
|
|
{
|
|
bool res = false;
|
|
if(SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, host))
|
|
{
|
|
SCNetworkReachabilityFlags flags;
|
|
if(SCNetworkReachabilityGetFlags(ref, &flags))
|
|
{
|
|
if(flags & kSCNetworkReachabilityFlagsReachable)
|
|
res = true;
|
|
}
|
|
CFRelease(ref);
|
|
}
|
|
return res;
|
|
}
|
|
|
|
} /* network */ |