Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
INetworkService.cs
1using System.Runtime.CompilerServices;
3
5{
11 [DefaultImplementation(typeof(NetworkService))]
13 {
17 event EventHandler<ConnectivityChangedEventArgs>? ConnectivityChanged;
18
24 Task<(string HostName, int Port, bool IsIpAddress)> LookupXmppHostnameAndPort(string domainName);
25
29 bool IsOnline { get; }
30
39 Task<bool> TryRequest(Func<Task> func, bool rethrowException = false, bool displayAlert = true, [CallerMemberName] string memberName = "");
40
50 Task<(bool Succeeded, TReturn? ReturnValue)> TryRequest<TReturn>(Func<Task<TReturn>> func, bool rethrowException = false, bool displayAlert = true, [CallerMemberName] string memberName = "");
51 }
52}
A service that can be loaded and unloaded at will. Typically during startup and shutdown of an applic...
The network service is a wafer-thin wrapper around the Connectivity object. It exposes an event handl...
Task<(bool Succeeded, TReturn? ReturnValue)> TryRequest< TReturn >(Func< Task< TReturn > > func, bool rethrowException=false, bool displayAlert=true, [CallerMemberName] string memberName="")
Tries to execute a arbitrary request. If there's an error this method catches it, logs it,...
Task< bool > TryRequest(Func< Task > func, bool rethrowException=false, bool displayAlert=true, [CallerMemberName] string memberName="")
Tries to execute a arbitrary request. If there's an error this method catches it, logs it,...
Task<(string HostName, int Port, bool IsIpAddress)> LookupXmppHostnameAndPort(string domainName)
Performs a DNS lookup for the specified domain name.
EventHandler< ConnectivityChangedEventArgs >? ConnectivityChanged
Triggers whenever network connectivity changes.
bool IsOnline
Determines whether we have network (wifi/cellular/other) or not.