Reconnection strategy

This document outlines the VPN session reconnection logic and how to configure the SDK's reconnection behavior.

Session reconnection functionality is available only with usage of new API method StartVpnSession/StartVpnSessionAsync which combines GetCredentialsRequest and StartVpnRequest steps. Otherwise the error code ReconnectionCredentialsNotCached will be sent by SDK when session reconnection is initiated, see the Error processing article.

The session reconnection powered by SDK is disabled by default. Please make sure that reconnection handled by your application logic is disabled when SDK reconnection is enabled.

Session Reconnection Behavior

The SDK will automatically handle network reconnection when the user switches between networks without disconnection (error code PrimaryNetworkInterfaceChanged from StateChanged event). Support of other connection errors will be added in one of the future releases.

The SDK behavior on network switch will be: stop the tunnel with appropriate error code PrimaryNetworkInterfaceChanged and tries to restore the connection with last used VPN settings.

Enabling Session Reconnection

To check if VPN session reconnection functionality is enabled, you can use the following method:

var sdk = new SDK();
var value = await sdk.IsReconnectionEnabledAsync().ConfigureAwait(false);

To enable/disable the automatic reconnection behavior, you can use the following method:

var sdk = new SDK();
await sdk.SetReconnectionEnabledAsync(value).ConfigureAwait(false);

Last updated

Was this helpful?