<!--
{
  "documentType" : "article",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/scnetworkconnection-g7e",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "SCNetworkConnection"
}
-->

# SCNetworkConnection

## Overview

The `SCNetworkConnection` programming interface contains functions that allow an application to control connection-oriented services defined in the system and get connection-status information. Note that these functions allow you to control and get information about existing services only. If you need to create, change, or remove services, you should use the `SCNetworkConfiguration` programming interface instead.

> Note:
> Currently, only PPP services can be controlled.

## Topics

### Getting Connection-Status Information

[`func SCNetworkConnectionGetTypeID() -> CFTypeID`](/documentation/SystemConfiguration/SCNetworkConnectionGetTypeID())

Returns the type identifier of all `SCNetworkConnection` instances.

[`func SCNetworkConnectionCopyUserPreferences(CFDictionary?, UnsafeMutablePointer<Unmanaged<CFString>?>, UnsafeMutablePointer<Unmanaged<CFDictionary>?>) -> Bool`](/documentation/SystemConfiguration/SCNetworkConnectionCopyUserPreferences(_:_:_:))

Provides the default service ID and a dictionary of user options for the specified connection.

[`func SCNetworkConnectionCopyServiceID(SCNetworkConnection) -> CFString?`](/documentation/SystemConfiguration/SCNetworkConnectionCopyServiceID(_:))

Returns the service ID associated with the specified network connection.

[`func SCNetworkConnectionGetStatus(SCNetworkConnection) -> SCNetworkConnectionStatus`](/documentation/SystemConfiguration/SCNetworkConnectionGetStatus(_:))

Returns the status of the specified network connection.

[`func SCNetworkConnectionCopyExtendedStatus(SCNetworkConnection) -> CFDictionary?`](/documentation/SystemConfiguration/SCNetworkConnectionCopyExtendedStatus(_:))

Returns the extended status of the connection.

[`func SCNetworkConnectionCopyStatistics(SCNetworkConnection) -> CFDictionary?`](/documentation/SystemConfiguration/SCNetworkConnectionCopyStatistics(_:))

Returns the statistics of the specified connection.

[`func SCNetworkConnectionCopyUserOptions(SCNetworkConnection) -> CFDictionary?`](/documentation/SystemConfiguration/SCNetworkConnectionCopyUserOptions(_:))

Gets the user options used to start the specified connection.

### Starting and Stopping a Connection

[`func SCNetworkConnectionStart(SCNetworkConnection, CFDictionary?, Bool) -> Bool`](/documentation/SystemConfiguration/SCNetworkConnectionStart(_:_:_:))

Starts the connection process for the specified network connection.

[`func SCNetworkConnectionStop(SCNetworkConnection, Bool) -> Bool`](/documentation/SystemConfiguration/SCNetworkConnectionStop(_:_:))

Stops the connection process for the specified network connection.

### Scheduling a Connection Reference on a Run Loop

[`func SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnection, CFRunLoop, CFString) -> Bool`](/documentation/SystemConfiguration/SCNetworkConnectionScheduleWithRunLoop(_:_:_:))

Schedules the specified connection with the specified run loop.

[`func SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnection, CFRunLoop, CFString) -> Bool`](/documentation/SystemConfiguration/SCNetworkConnectionUnscheduleFromRunLoop(_:_:_:))

Unschedules the specified connection from the specified run loop.

### Creating a Connection Reference

[`func SCNetworkConnectionCreateWithServiceID(CFAllocator?, CFString, SCNetworkConnectionCallBack?, UnsafeMutablePointer<SCNetworkConnectionContext>?) -> SCNetworkConnection?`](/documentation/SystemConfiguration/SCNetworkConnectionCreateWithServiceID(_:_:_:_:))

Creates a new connection reference to use for getting the status or for connecting or disconnecting the associated service.

### Specifying a Dispatch Queue and Enabling Notifications

[`func SCNetworkConnectionSetDispatchQueue(SCNetworkConnection, dispatch_queue_t?) -> Bool`](/documentation/SystemConfiguration/SCNetworkConnectionSetDispatchQueue(_:_:))

Specifies a dispatch queue to use for the connection’s callback function and enables notifications.

### Data Types

[`class SCNetworkConnection`](/documentation/SystemConfiguration/SCNetworkConnection)

The handle to manage a connection-oriented service.

[`typealias SCNetworkConnectionCallBack`](/documentation/SystemConfiguration/SCNetworkConnectionCallBack)

The type of callback function used when a status event is delivered.

[`struct SCNetworkConnectionContext`](/documentation/SystemConfiguration/SCNetworkConnectionContext)

A structure containing user-specified data and callbacks for a network connection.

### Constants

[`enum SCNetworkConnectionStatus`](/documentation/SystemConfiguration/SCNetworkConnectionStatus)

The current status of the network connection.

[`enum SCNetworkConnectionPPPStatus`](/documentation/SystemConfiguration/SCNetworkConnectionPPPStatus)

The PPP-specific status of the network connection.

[Statistics Dictionary Keys](/documentation/SystemConfiguration/statistics-dictionary-keys)

Keys associated with values in the statistics dictionary.

[Selection Options Dictionary Keys](/documentation/SystemConfiguration/selection-options-dictionary-keys)

Keys used with the [`SCNetworkConnectionCopyUserPreferences(_:_:_:)`](/documentation/SystemConfiguration/SCNetworkConnectionCopyUserPreferences(_:_:_:)) selection options dictionary.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)