Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NrServers.cs
1using System.Threading.Tasks;
4
6{
11 {
15 public NrServers()
16 {
17 }
18
22 public override string Name => "NrServers";
23
31 public override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
32 {
33 int c = 0;
34
35 foreach (S2sEndpointStatistics Connection in XmppServerModule.GetServerConnectionStatistics())
36 {
37 if (Connection.State.HasValue && Connection.State.Value == XmppS2sState.Connected)
38 c++;
39 }
40
41 await ResponseCallback(c.ToString(), string.Empty);
42 }
43
47 public override string[] HelpParagraphs => new string[] { "Returns the number of connected servers." };
48 }
49}
Mainstains information about connectivity from a specific s2s endpoint.
An administrative command with no parameters.
Returns the number of connected servers.
Definition: NrServers.cs:11
NrServers()
Returns the number of connected servers.
Definition: NrServers.cs:15
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
Executes the command.
Definition: NrServers.cs:31
override string[] HelpParagraphs
Markdown description of syntax.
Definition: NrServers.cs:47
Service Module hosting the XMPP broker and its components.
XmppS2sState
State of XMPP connection.
Definition: XmppS2sState.cs:7
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.