---
title: CFNetServiceResolve
framework: cfnetwork
role: symbol
role_heading: Function
path: cfnetwork/cfnetserviceresolve
---

# CFNetServiceResolve

This function updates the specified CFNetService with the IP address or addresses associated with the service. Call CFNetServiceGetAddressing(_:) to get the addresses.

## Declaration

```occ
extern Boolean CFNetServiceResolve(CFNetServiceRef theService, CFStreamError *error);
```

## Parameters

- `theService`: The CFNetService to resolve; cannot be NULL. The resolution will fail if the service doesn’t have a domain, a type, and a name.
- `error`: A pointer to a doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError structure that will be set to an error code and the error code’s domain if an error occurs; or NULL if you don’t want to receive the error code and its domain.

## Return Value

Return Value TRUE if an asynchronous service resolution was started or if a synchronous service resolution updated the CFNetService; FALSE if an asynchronous or synchronous resolution failed or if a synchronous resolution was canceled.

## Discussion

Discussion When resolving a service that runs in asynchronous mode, this function returns TRUE if the CFNetService has a domain, type, and name, and the underlying resolution process was started. Otherwise, this function returns FALSE. Once started, the resolution continues until it is canceled by calling CFNetServiceCancel(_:). When resolving a service that runs in synchronous mode, this function blocks until the CFNetService is updated with at least one IP address, until an error occurs, or until CFNetServiceCancel(_:) is called. Special Considerations This function is thread safe. If the service will be used in asynchronous mode, you must call CFNetServiceSetClient(_:_:_:) before calling this function.

## See Also

### Network Services

- [CFNetService](cfnetwork/cfnetservice.md)
- [CFNetServiceBrowser](cfnetwork/cfnetservicebrowser.md)
- [CFNetServiceBrowserFlags](cfnetwork/cfnetservicebrowserflags.md)
- [CFNetServiceMonitor](cfnetwork/cfnetservicemonitor.md)
- [CFNetServiceMonitorType](cfnetwork/cfnetservicemonitortype.md)
- [CFNetServiceClientContext](cfnetwork/cfnetserviceclientcontext.md)
- [CFNetServiceRegisterFlags](cfnetwork/cfnetserviceregisterflags.md)
- [CFNetServicesError](cfnetwork/cfnetserviceserror.md)
- [CFNetServiceBrowserInvalidate(_:)](cfnetwork/cfnetservicebrowserinvalidate(_:).md)
- [CFNetServiceBrowserScheduleWithRunLoop(_:_:_:)](cfnetwork/cfnetservicebrowserschedulewithrunloop(_:_:_:).md)
- [CFNetServiceBrowserCreate(_:_:_:)](cfnetwork/cfnetservicebrowsercreate(_:_:_:).md)
- [CFNetServiceBrowserGetTypeID()](cfnetwork/cfnetservicebrowsergettypeid().md)
- [CFNetServiceBrowserSearchForDomains(_:_:_:)](cfnetwork/cfnetservicebrowsersearchfordomains(_:_:_:).md)
- [CFNetServiceBrowserSearchForServices(_:_:_:_:)](cfnetwork/cfnetservicebrowsersearchforservices(_:_:_:_:).md)
- [CFNetServiceBrowserStopSearch(_:_:)](cfnetwork/cfnetservicebrowserstopsearch(_:_:).md)
