1using System.Collections.Generic;
3using System.Threading.Tasks;
13 private static readonly Dictionary<string, XmppBroker> brokers =
new Dictionary<string, XmppBroker>();
25 public static string GetKey(
string Host,
int Port,
bool Tls,
string UserName,
string Password,
string PasswordMechanism)
27 StringBuilder sb =
new StringBuilder();
30 sb.AppendLine(Port.ToString());
31 sb.AppendLine(Tls.ToString());
32 sb.AppendLine(UserName);
33 sb.AppendLine(Password);
34 sb.AppendLine(PasswordMechanism);
54 string UserName,
string Password,
string PasswordMechanism,
bool TrustServer,
bool AllowInsecureMechanisms)
60 if (brokers.TryGetValue(Key, out Broker))
64 Broker = await
XmppBroker.
Create(Node, Host, Port, Tls, UserName, Password, PasswordMechanism, TrustServer, AllowInsecureMechanisms);
68 if (brokers.ContainsKey(Key))
75 brokers[Key] = Broker;
91 if (!brokers.TryGetValue(Key, out Broker))
Contains methods for simple hash calculations.
static string ComputeSHA1HashString(byte[] Data)
Computes the SHA-1 hash of a block of binary data.
Represents an XMPP broker.
static async Task< XmppBroker > Create(XmppBrokerNode Node, string Host, int Port, bool Tls, string UserName, string Password, string PasswordMechanism, bool TrustServer, bool AllowInsecureMechanisms)
Creates an XMPP broker
void Dispose()
IDisposable.Dispose
Static class managing connections to XMPP brokers.
static string GetKey(string Host, int Port, bool Tls, string UserName, string Password, string PasswordMechanism)
Gets sort key for XMPP broker
static async Task< XmppBroker > GetBroker(XmppBrokerNode Node, string Key, string Host, int Port, bool Tls, string UserName, string Password, string PasswordMechanism, bool TrustServer, bool AllowInsecureMechanisms)
Gets an XMPP broker object instance.
static void DestroyBroker(string Key)
Destroys a broker object instance
Node representing an XMPP broker.