• agsxmpp 和 openfire 服务器 通信


    如题, 一直做c#, 最近做openfire 开发,所以我选择 agsxmpp 做测试的客户端,以下是遇到的问题及解决方法
    1. openfire  发送数据流  是通过 PLAIN 的 , 而 agsxmpp 是默认是 通过DIGEST-MD5 发送
    2. openfire 发送iq节  不接收 to属性

    集体解决方案

    1. 修改 agsxmpp 里的Mechanism.cs 里  
                         //case "DIGEST-MD5": //我加的 注释掉  case "DIGEST-MD5": 使plain 变为   默认设置
                        //return MechanismType.DIGEST_MD5;

      注释 case “Digest-md5” ,从而把agsxmpp的 默认发式 改为 PLAIN

    2.修改 agsxmpp IqGrabber.cs  里的 public void SendIq(IQ iq, IqCB cb, object cbArg) 函数
           修改后如:  public void SendIq(IQ iq, IqCB cb, object cbArg)
                    {
                // check if the callback is null, in case of wrong usage of this class
                if (cb != null)
                {
                    TrackerData td = new TrackerData();
                    td.cb = cb;
                    td.data = cbArg;

                    m_grabbing[iq.Id] = td;


                    //我加的代码  iq在agsxmpp中发送Iq节的时候先iq.RemoveAttribute("to")
                    iq.RemoveAttribute("to");
                }
             m_connection.Send(iq);
         }

  • 相关阅读:
    python socket练习
    python异常处理
    python类的反射
    类的特殊成员方法
    staticmethod classmethod property方法
    类的多态
    类的析构、继承
    python subprocess模块
    python面向对象
    discuz 使模板中的函数不解析 正常使用
  • 原文地址:https://www.cnblogs.com/ilahsa/p/2680126.html
Copyright © 2020-2023  润新知