<!--
{
  "availability" : [
    "macOS: 10.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/SCNetworkConnectionCreateWithServiceID(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "System Configuration"
    ],
    "preciseIdentifier" : "c:@F@SCNetworkConnectionCreateWithServiceID"
  },
  "title" : "SCNetworkConnectionCreateWithServiceID(_:_:_:_:)"
}
-->

# SCNetworkConnectionCreateWithServiceID(_:_:_:_:)

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

```
func SCNetworkConnectionCreateWithServiceID(_ allocator: CFAllocator?, _ serviceID: CFString, _ callout: SCNetworkConnectionCallBack?, _ context: UnsafeMutablePointer<SCNetworkConnectionContext>?) -> SCNetworkConnection?
```

## Parameters

`allocator`

The allocator that should be used to allocate memory for the connection structure. This parameter may be `NULL`, in which case the current default allocator is used. If this reference is not a valid allocator, the behavior is undefined.

`serviceID`

The service identifier of the connection. This value uniquely identifies service in the system configuration database.

`callout`

The function to be called when the status of the connection changes. If this parameter is `NULL`, the application receives notifications of status change and will need to poll for updates.

`context`

User-specified data associated with the connection.

## Return Value

A reference to a new network connection.

## Discussion

---

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)