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


@interface NETunnelProviderSession : NEVPNConnection


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

- startTunnelWithOptions:andReturnError:

Start the process of connecting the tunnel.

- stopTunnel

Start the process of disconnecting the tunnel.

Communicating with the Tunnel Provider

- sendProviderMessage:returnError:responseHandler:

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.


Inherits From

See Also

VPN Control


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