Table of Contents

Interface IDaemonChannel

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

Defines where the service hands its API's address and token, to an administrator alone: a named pipe on Windows, a Unix socket on Linux, each telling who calls.

public interface IDaemonChannel

Methods

Connect(CancellationToken)

Opens a client's side.

Task<Stream> Connect(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<Stream>

A task whose result is the connection's stream.

Exceptions

OperationCanceledException

cancellationToken was canceled.

SocketException

On Linux, the channel's socket could not be reached.

TimeoutException

On Windows, the channel did not answer in time.

InvalidOperationException

On Windows, the service has not opened its channel, or someone not trusted serves it.

Listen(CancellationToken)

Opens the service's side, which takes callers until disposed.

Task<IDaemonChannelListener> Listen(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<IDaemonChannelListener>

A task whose result is the listener.