Instance Method

startTunnelWithOptions:andReturnError:

Start the process of connecting the tunnel.

Declaration

- (BOOL)startTunnelWithOptions:(NSDictionary<NSString *,id> *)options andReturnError:(NSError * _Nullable *)error;

Parameters

options

A dictionary containing options to be passed to the Tunnel Provider extension.

error

A pointer to a pointer to an NSError object. If specified and the tunnel connection process cannot be started due to an error, this parameter will be set to point to an NSError object containing details about the error.

Discussion

This method returns immediately after starting the process of connecting the tunnel. In order to be notified when the tunnel is fully connected, register to observe the NEVPNStatusDidChangeNotification notification on the NETunnelProviderSession object and examine its status property when the notification is received.

See Also

Controlling the Tunnel Connection

- stopTunnel

Start the process of disconnecting the tunnel.