agsxmpp+openfire实现即时通讯 目前不知道如何连接 已下载模版
http://download.csdn.net/download/tgm_s618/5246887
求指导怎么连接上OPenfire上面

解决方案 »

  1.   

    我贴一下以前看的2篇文档一,
    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的 默认发式 改为 PLAIN2.修改 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);
    }
      

  2.   


    agsxmpp client 连接openfire
    发布时间:2012-09-11 发布来源: 
    用户可以经过过程三种体式格局接见SMS GupShup:互联网、和浏览器。你可以遵守爱好参加不合的群组。今朝该收集上有500万个用户自发社区,25000家小公司,以及500家国表里品牌公司。
    生活生计中最大的满足就是意识到应尽的任务。 
    agsxmpp 连接openfire 
    无数事实申明,只有把全副身心投入进去,收视反听,不断改进,不畏劳苦,毫不平服,才有可能攀及第学岑岭。
    需批改源代码如下:
    1. 批改 agsxmpp 里的Mechanism.cs 里 
    //case "DIGEST-MD5": //注释掉 case "DIGEST-MD5": 使plain 变为 默认设置
    //return MechanismType.DIGEST_MD5;注释 case “Digest-md5” ,从而把agsxmpp的 默认发式 改为 PLAIN2.批改 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);
    }
    3.openfire XMPP就事器默认只IPV4的地址,而agsxmpp连接就事器时辰选择的是IPV6版本的地址
    批改ClientSocket.cs里的 IPAddress ipAddress =ipHostInfo.AddressList[0]; 改为 IPAddress ipAddress = ipHostInfo.AddressList[2]; 
    不然会呈现 办事器拒绝接见的错误
      

  3.   

    @hanjun0612  虽然好像没什么用~~~~但还是谢谢 可以下载http://download.csdn.net/download/tgm_s618/5246887试试怎么连接
      

  4.   

    @hanjun0612 好的!!
      

  5.   

    这个是我之前给的实例,记得如果配置没问题,是可以直接运行的,你看看,
    这个下载地址里,有说明的
    http://download.csdn.net/detail/hanjun1213/4789760