An object to start and stop a tunnel connection and get its status.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
NETunnelProviderSession objects control network tunnel connections provided by Tunnel Provider extensions.
NETunnelProviderSession objects are not instantiated directly. Instead, each
NETunnelProviderManager object has an associated
NETunnelProviderSession as a read-only property.
Controlling the Tunnel Connection
Communicating with the Tunnel Provider
func sendProviderMessage(Data, responseHandler: ((Data?) -> Void)?)
Send a message to the Tunnel Provider extension. If the extension is not running, it should be launched to handle the message. If this method can’t start sending the message it reports an error in the
returnError parameter. If an error occurs while sending the message or returning the result,
nil should be sent to the response handler as notification.