Class DaemonChannelClient
- Assembly
- VpnHood.AppUi.Hosting.Desktop.Daemon.dll
Provides a client's side of the service's channel: say hello, read the answer.
public static class DaemonChannelClient
- Inheritance
-
DaemonChannelClient
- Inherited Members
Methods
AskOnce(IDaemonChannel, CancellationToken)
Asks the service once, over a connection of its own.
public static Task<DaemonChannelAnswer> AskOnce(IDaemonChannel channel, CancellationToken cancellationToken)
Parameters
channelIDaemonChannelThe service's channel.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<DaemonChannelAnswer>
A task whose result is the answer.
Exceptions
- SocketException
On Linux, the channel's socket could not be reached.
- TimeoutException
On Windows, the channel did not answer in time.
- IOException
The service closed the channel before answering.
- InvalidOperationException
On Windows, the service has not opened its channel, or someone not trusted serves it.
- OperationCanceledException
cancellationTokenwas canceled.