---
title: "CFHostGetReachability(_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfhostgetreachability(_:_:)"
---

# CFHostGetReachability(_:_:)

Gets reachability information from a host.

## Declaration

```swift
func CFHostGetReachability(_ theHost: CFHost, _ hasBeenResolved: UnsafeMutablePointer<DarwinBoolean>?) -> Unmanaged<CFData>?
```

## Parameters

- `theHost`: The host whose reachability is to be obtained. The host must have been previously resolved. (To resolve a host, call doc://com.apple.cfnetwork/documentation/CFNetwork/CFHostStartInfoResolution(_:_:_:).) This value must not be NULL.
- `hasBeenResolved`: On return, contains TRUE if the reachability was available, otherwise FALSE. This value may be NULL.

## Return Value

Return Value A CFData object that wraps the reachability flags (SCNetworkConnectionFlags) defined in SystemConfiguration/SCNetwork.h, or NULL if reachability information was not available.

## Discussion

Discussion This function gets reachability information in a thread-safe way, but the resulting data is not thread-safe. The data is returned as a “get” as opposed to a copy, so the data is not safe if the CFHost is altered from another thread.

## See Also

### Hosts

- [CFHost](cfnetwork/cfhost.md)
- [CFHostInfoType](cfnetwork/cfhostinfotype.md)
- [CFHostClientContext](cfnetwork/cfhostclientcontext.md)
- [CFHostCancelInfoResolution(_:_:)](cfnetwork/cfhostcancelinforesolution(_:_:).md)
- [CFHostCreateCopy(_:_:)](cfnetwork/cfhostcreatecopy(_:_:).md)
- [CFHostCreateWithAddress(_:_:)](cfnetwork/cfhostcreatewithaddress(_:_:).md)
- [CFHostCreateWithName(_:_:)](cfnetwork/cfhostcreatewithname(_:_:).md)
- [CFHostGetAddressing(_:_:)](cfnetwork/cfhostgetaddressing(_:_:).md)
- [CFHostGetNames(_:_:)](cfnetwork/cfhostgetnames(_:_:).md)
- [CFHostGetTypeID()](cfnetwork/cfhostgettypeid().md)
- [CFHostScheduleWithRunLoop(_:_:_:)](cfnetwork/cfhostschedulewithrunloop(_:_:_:).md)
- [CFHostSetClient(_:_:_:)](cfnetwork/cfhostsetclient(_:_:_:).md)
- [CFHostStartInfoResolution(_:_:_:)](cfnetwork/cfhoststartinforesolution(_:_:_:).md)
- [CFHostUnscheduleFromRunLoop(_:_:_:)](cfnetwork/cfhostunschedulefromrunloop(_:_:_:).md)
