VpnChannel.ReplaceAndAssociateTransport(Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Replaces an existing transport with a new one for use by the VPN framework as a transport link communicating the VPN plug-in to the VPN server.
public:
virtual void ReplaceAndAssociateTransport(Platform::Object ^ transport, Platform::Object ^ context) = ReplaceAndAssociateTransport;
void ReplaceAndAssociateTransport(IInspectable const& transport, IInspectable const& context);
public void ReplaceAndAssociateTransport(object transport, object context);
function replaceAndAssociateTransport(transport, context)
Public Sub ReplaceAndAssociateTransport (transport As Object, context As Object)
Parameters
- transport
-
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.
- context
-
Object
Platform::Object
IInspectable
The transport context object to use, for example the name of a host or server.
Windows requirements
Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v6.0)
|
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 transport object. The socket must have not been connected at the time of this call, otherwise the call will fail with an invalid parameter error.