Android.Net.VpnService.Protect Method
Protect a socket from VPN connections.

Syntax

[Android.Runtime.Register("protect", "(I)Z", "GetProtect_IHandler")]
public virtual bool Protect (int socket)

Parameters

socket
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Protect a socket from VPN connections. After protecting, data sent through this socket will go directly to the underlying network, so its traffic will not be forwarded through the VPN. This method is useful if some connections need to be kept outside of VPN. For example, a VPN tunnel should protect itself if its destination is covered by VPN routes. Otherwise its outgoing packets will be sent back to the VPN interface and cause an infinite loop. This method will fail if the application is not prepared or is revoked.

The socket is NOT closed by this method.

[Android Documentation]

Requirements

Namespace: Android.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14