2using System.Collections.Generic;
3using System.Diagnostics;
5using System.Threading.Tasks;
20 internal static Task RequestHandler(
object Sender,
IqEventArgs e)
23 StringBuilder Xml =
new StringBuilder();
25 Xml.Append(
"<resp xmlns='");
26 Xml.Append(e.
Query.NamespaceURI);
28 if (Now.
Ticks.HasValue)
31 Xml.Append(Now.
Ticks.Value.ToString());
32 Xml.Append(
"' freq='");
33 Xml.Append(Stopwatch.Frequency.ToString());
38 Xml.Append(
"</resp>");
42 return Task.CompletedTask;
52 Xml.Append(Timestamp.
Year.ToString(
"D4"));
54 Xml.Append(Timestamp.
Month.ToString(
"D2"));
56 Xml.Append(Timestamp.
Day.ToString(
"D2"));
58 Xml.Append(Timestamp.
Hour.ToString(
"D2"));
60 Xml.Append(Timestamp.
Minute.ToString(
"D2"));
62 Xml.Append(Timestamp.
Second.ToString(
"D2"));
75 internal static Task ClockSourceReq(
object Sender,
IqEventArgs e)
79 if (!
string.IsNullOrEmpty(Server.
Domain))
81 StringBuilder Xml =
new StringBuilder();
83 Xml.Append(
"<sourceResp xmlns='");
84 Xml.Append(e.
Query.NamespaceURI);
87 Xml.Append(
"</sourceResp>");
94 return Task.CompletedTask;
Event arguments for IQ queries.
Task IqResult(string Xml, string From)
Returns a response to the current request.
Task IqErrorItemNotFound(XmppAddress From, string ErrorText, string Language)
Returns a item-not-found error.
XmlElement Query
Query element, if found, null otherwise.
XmppAddress To
To address attribute
CaseInsensitiveString Domain
Domain name.
Service helping services synchronize their clocks over the Internet.
static void Encode(DateTimeHF Timestamp, StringBuilder Xml)
Encodes a high-frequency based Date and Time value to XML.
Date and Time value based on the intenal high-frequency timer.
long? Ticks
High-resolution timer ticks.
int Nanosecond100
100-nanosecond
int Millisecond
Millisecond
int Microsecond
Microsecond
Service Module hosting the XMPP broker and its components.
static DateTimeHF Now
Current high-resolution date and time