Share via


VpnChannel.ActivityStateChange Event

Definition

Event raised when the channel's activity state has changed. Used by VPN plug-ins to determine whether the channel is active with traffic or idle.

// Register
event_token ActivityStateChange(TypedEventHandler<VpnChannel, VpnChannelActivityStateChangedArgs const&> const& handler) const;

// Revoke with event_token
void ActivityStateChange(event_token const* cookie) const;

// Revoke with event_revoker
VpnChannel::ActivityStateChange_revoker ActivityStateChange(auto_revoke_t, TypedEventHandler<VpnChannel, VpnChannelActivityStateChangedArgs const&> const& handler) const;
public event TypedEventHandler<VpnChannel,VpnChannelActivityStateChangedArgs> ActivityStateChange;
function onActivityStateChange(eventArgs) { /* Your code */ }
vpnChannel.addEventListener("activitystatechange", onActivityStateChange);
vpnChannel.removeEventListener("activitystatechange", onActivityStateChange);
- or -
vpnChannel.onactivitystatechange = onActivityStateChange;
Public Custom Event ActivityStateChange As TypedEventHandler(Of VpnChannel, VpnChannelActivityStateChangedArgs) 

Event Type

Windows requirements

App capabilities
networkingVpnProvider

Applies to