protected ProtocolNode AddFeatures() { var child = new ProtocolNode("receipt_acks", null, null, String.Empty); var parent = new ProtocolNode("stream:features", null, new[] { child }.ToList(), String.Empty); return(parent); }
protected void WriteInternal(ProtocolNode node) { var len = 1; if (node.attributeHash != null) { len += node.attributeHash.Count * 2; } if (node.children.Count > 0) { ++len; } if (node.data.Length > 0) { ++len; } this.WriteListStart(len); this.WriteString(node.tag); this.WriteAttributes(node.attributeHash); if (node.data.Length > 0) { this.writeBytes(node.data); } if (node.children.Count > 0) { this.WriteListStart(node.children.Count); foreach (var child in node.children) { this.WriteInternal(child); } } }
protected ProtocolNode AddAuth() { var authHash = new Dictionary <string, string>(); authHash.Add("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); authHash.Add("mechanism", "DIGEST-MD5-1"); var node = new ProtocolNode("auth", authHash, null, String.Empty); return(node); }
public string Write(ProtocolNode node) { if (node != null) { this.output += "\x00"; } else { this.WriteInternal(node); } return(this.FlushBuffer()); }
public ProtocolNode GetChild(string tag) { ProtocolNode returnValue = null; if (this.children != null) { returnValue = (from x in children where String.Compare(x.tag, tag) == 0 select x).FirstOrDefault(); if (returnValue == null) { returnValue = (from x in children where x.GetChild(tag) != null select x).FirstOrDefault(); } } return(returnValue); }
protected void ProcessChallenge(ProtocolNode node) { }
protected void SendNode(ProtocolNode node) { }