Share via


VpnChannel.AssociateTransport(Object, Object) Method

Definition

Prepares and marks the transport for use by the VPN framework as a transport link communicating the VPN plug-in to the VPN server. This call must be performed before any other operations related to the VPN framework APIs.

public:
 virtual void AssociateTransport(Platform::Object ^ mainOuterTunnelTransport, Platform::Object ^ optionalOuterTunnelTransport) = AssociateTransport;
void AssociateTransport(IInspectable const& mainOuterTunnelTransport, IInspectable const& optionalOuterTunnelTransport);
public void AssociateTransport(object mainOuterTunnelTransport, object optionalOuterTunnelTransport);
function associateTransport(mainOuterTunnelTransport, optionalOuterTunnelTransport)
Public Sub AssociateTransport (mainOuterTunnelTransport As Object, optionalOuterTunnelTransport As Object)

Parameters

mainOuterTunnelTransport
Object

Platform::Object

IInspectable

An IInspectable object for socket transport. This object can be a Windows.Networking.Sockets.StreamSocket or a Windows.Networking.DatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data. The socket must be unconnected at the point of the call.

optionalOuterTunnelTransport
Object

Platform::Object

IInspectable

An optional IInspectable object for socket transport. This object can be a Windows.Networking.Sockets.StreamSocket or a Windows.Networking.DatagramSocket. This socket will control the connection to the VPN server and will be used to send encapsulated IP packets and receive encapsulated data.

Windows requirements

App capabilities
networkingVpnProvider

Remarks

If the function succeeds, the return value is S_OK, otherwise the function will return an error hresult value describing the specific failure. If the plug-in is not connected, the error will be E_ACCESSDENIED.

Note

Any call to this API outside of a connected VPN plug-in will fail, as activity and interactions between the VPN plug-in and the system are controlled by the VPN profile. The call will fail if the VPN framework does not support the specified type of transport implemented by the outerTunnelTransport object. The socket must have not been connected at the time of this call, otherwise the call will fail with an invalid parameter error.

From this method, a plugin may choose between the following combinations of sockets:

Applies to