Table of Contents

Interface IVpnServiceHandler

Namespace
VpnHood.Core.Client.VpnServices.Host
Assembly
VpnHood.Core.Client.VpnServices.Host.dll

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

bool

Methods

CreateAdapter(VpnAdapterSettings, string?)

Makes the VPN adapter for a connection.

IVpnAdapter CreateAdapter(VpnAdapterSettings adapterSettings, string? debugData)

Parameters

adapterSettings VpnAdapterSettings

The adapter's settings.

debugData string

The 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

connectionInfo ConnectionInfo

The connection's info.

cancellationToken CancellationToken

The 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()