Class

NETunnelProviderSession

An object to start and stop a tunnel connection and get its status.

Declaration

class NETunnelProviderSession : NEVPNConnection

Overview

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.

Topics

Controlling the Tunnel Connection

func startTunnel(options: [String : Any]?)

Start the process of connecting the tunnel.

func stopTunnel()

Start the process of disconnecting the tunnel.

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.

Relationships

Inherits From

Conforms To

See Also

VPN Control

class NEVPNConnection

An object to start and stop a Personal VPN connection and get its status.