Table of Contents

Class DesktopHost

Namespace
VpnHood.AppUi.Hosting.Desktop.Daemon
Assembly
VpnHood.AppUi.Hosting.Desktop.Daemon.dll

Provides a desktop head's whole run: one binary with three jobs, chosen by the first word on the command line, the service that holds the app, the window that shows it, and the commands that drive it from a shell.

public static class DesktopHost
Inheritance
DesktopHost
Inherited Members

Remarks

A head gives the product facts only it can give (DesktopInitParams), a platform package the machine facts only it can give (IDesktopPlatform), and this joins them. The VPN service is a binary of its own beside it, the VPN host, which the service starts at each connect; dev runs the app and the window in one process. Run alone, the window's executable opens the window, and the command a person types prints its help.

Methods

HostDaemonStoppedBySignal(DaemonRun, CancellationToken)

Runs the service where a signal stops it, as on Linux: the parser cancels the token at the signal, and the app's graceful close then gives way to its quick one after a while, before the process ends.

public static Task<int> HostDaemonStoppedBySignal(DaemonRun run, CancellationToken cancellationToken)

Parameters

run DaemonRun

The service's run.

cancellationToken CancellationToken

The token the parser cancels at the signal.

Returns

Task<int>

A task whose result is the process's exit code.

Run(string[], DesktopInitParams, IDesktopPlatform)

Runs what the command line asks for, and blocks until it ends: the work runs off the calling thread and the UI on it, so a head calls it from its Main, on Windows its [STAThread] one.

public static int Run(string[] args, DesktopInitParams initParams, IDesktopPlatform platform)

Parameters

args string[]

The process's command-line arguments.

initParams DesktopInitParams

The head's init params.

platform IDesktopPlatform

What the platform says for itself.

Returns

int

The process's exit code.