Interface IDaemonChannel
- 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
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- OperationCanceledException
cancellationTokenwas 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
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<IDaemonChannelListener>
A task whose result is the listener.