Subject: BUG: XmppClientConnection.Send(Element e)
- public override void Send(Element e)
- {
- if (!(ClientSocket is BoshClientSocket))
- {
- // this is a hack to not send the xmlns="jabber:client" with all packets
- Element dummyEl = new Element("a");
- dummyEl.Namespace = Uri.CLIENT;
- dummyEl.AddChild(e);
- string toSend = dummyEl.ToString();
- Send(toSend.Substring(25, toSend.Length - 25 - 4));
- }
- else
- base.Send(e);
- }
It will cause offline exception if frequently send, should change to:
- public override void Send(Element e)
- {
- if (!(ClientSocket is BoshClientSocket))
- {
- if (string.IsNullOrEmpty(e.Namespace))
- {
- e.Namespace = Uri.CLIENT;
- }
- string data = e.ToString();
- Send(data);
- }
- else
- base.Send(e);
- }
lizhengjun
Show profile
Link to this post
