---
title: "CFHostCreateCopy(_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfhostcreatecopy(_:_:)"
---

# CFHostCreateCopy(_:_:)

Creates a new host object by copying.

## Declaration

```swift
func CFHostCreateCopy(_ alloc: CFAllocator?, _ host: CFHost) -> Unmanaged<CFHost>
```

## Parameters

- `alloc`: The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

## Return Value

Return Value A valid CFHost object or NULL if the copy could not be created. The new host contains a copy of all previously resolved data from the original host. Ownership follows the The Create Rule.

## Discussion

Discussion This function is thread safe.

## See Also

### Hosts

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