---
title: "CFNetServiceScheduleWithRunLoop(_:_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfnetserviceschedulewithrunloop(_:_:_:)"
---

# CFNetServiceScheduleWithRunLoop(_:_:_:)

Schedules a CFNetService on a run loop.

## Declaration

```swift
func CFNetServiceScheduleWithRunLoop(_ theService: CFNetService, _ runLoop: CFRunLoop, _ runLoopMode: CFString)
```

## Parameters

- `theService`: The CFNetService that is to be scheduled on a run loop; cannot be NULL.
- `runLoop`: The run loop on which the service is to be scheduled; cannot be NULL.
- `runLoopMode`: The mode on which to schedule the service; cannot be NULL.

## Discussion

Discussion Schedules the specified service on a run loop, which places the service in asynchronous mode. The caller is responsible for ensuring that at least one of the run loops on which the service is scheduled is being run. Special Considerations This function is thread safe. Before calling this function, call CFNetServiceSetClient(_:_:_:) to prepare a CFNetService for use in asynchronous mode.

## 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)
