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.

Symbols

Getting Connection-Status Information

func SCNetworkConnectionGetTypeID()

Returns the type identifier of all SCNetworkConnection instances.

func SCNetworkConnectionCopyServiceID(SCNetworkConnection)

Returns the service ID associated with the specified network connection.

func SCNetworkConnectionGetStatus(SCNetworkConnection)

Returns the status of the specified network connection.

func SCNetworkConnectionCopyExtendedStatus(SCNetworkConnection)

Returns the extended status of the connection.

func SCNetworkConnectionCopyStatistics(SCNetworkConnection)

Returns the statistics of the specified connection.

func SCNetworkConnectionCopyUserOptions(SCNetworkConnection)

Gets the user options used to start the specified connection.

Starting and Stopping a Connection

func SCNetworkConnectionStart(SCNetworkConnection, CFDictionary?, Bool)

Starts the connection process for the specified network connection.

func SCNetworkConnectionStop(SCNetworkConnection, Bool)

Stops the connection process for the specified network connection.

Scheduling a Connection Reference on a Run Loop

func SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnection, CFRunLoop, CFString)

Schedules the specified connection with the specified run loop.

func SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnection, CFRunLoop, CFString)

Unschedules the specified connection from the specified run loop.

Creating a Connection Reference

func SCNetworkConnectionCreateWithServiceID(CFAllocator?, CFString, SCNetworkConnectionCallBack?, UnsafeMutablePointer<SCNetworkConnectionContext>?)

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, DispatchQueue?)

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

Data Types

SCNetworkConnection

The handle to manage a connection-oriented service.

SCNetworkConnectionCallBack

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

SCNetworkConnectionContext

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

Constants

SCNetworkConnectionStatus

The current status of the network connection.

SCNetworkConnectionPPPStatus

The PPP-specific status of the network connection.

Statistics Dictionary Keys

Keys associated with values in the statistics dictionary.