Interface IVpnServiceHandler
Defines the platform's part of the VPN service the host runs: its adapter, its client factory, its notification, and its own end.
public interface IVpnServiceHandler
Properties
CanReconnect
Gets a value indicating whether the service may connect again by itself, with no start from the app or the system: false where only the system's start may bring an adapter up.
bool CanReconnect { get; }
Property Value
Methods
CreateAdapter(VpnAdapterSettings, string?)
Makes the VPN adapter for a connection.
IVpnAdapter CreateAdapter(VpnAdapterSettings adapterSettings, string? debugData)
Parameters
adapterSettingsVpnAdapterSettingsThe adapter's settings.
debugDatastringThe developer's debug switches (DebugData1), or null.
Returns
- IVpnAdapter
The adapter, which the client disposes with itself where AutoDisposeVpnAdapter says so, the default.
Exceptions
- InvalidOperationException
Windows has given the VPN plug-in no channel yet.
CreateClientFactory()
Names the factory that builds the VpnHoodClient for each connection. Return VpnHoodClientFactory for the default composition, or a derived factory to replace a single piece (filters, proxy connector, tracker). The host calls this per connection and keeps ownership of the created client (state wiring and dispose) — the factory must not hold a reference to it.
VpnHoodClientFactory CreateClientFactory()
Returns
- VpnHoodClientFactory
The factory.
ShowNotification(ConnectionInfo, CancellationToken)
Shows or updates the service's notification, where the platform has one.
void ShowNotification(ConnectionInfo connectionInfo, CancellationToken cancellationToken)
Parameters
connectionInfoConnectionInfoThe connection's info.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
StopNotification()
Removes the service's notification, where the platform has one.
void StopNotification()
StopSelf()
Ends the service itself, once its connection has ended with no other to follow.
void StopSelf()