首页 新闻 会员 周边 捐助

asp.net中使用agsxmpp实现即时通讯,连接openfire,无法连接

0
悬赏园豆:30 [已关闭问题] 关闭于 2014-07-02 09:48

asp.net中使用agsxmpp实现即时通讯,连接openfire,无法连接 。望有相关经验的大侠指点迷津,若哪位朋友能提供demo更是感激不尽了,在此先谢过了。下面是我改过的代码,改来改去都不行,感觉关键问题是xmpp_OnLogin方法事件中的编写。

      private XmppClientConnection xmpp=new XmppClientConnection();
        protected void Page_Load(object sender, EventArgs e)
        {
          //  Response.Write("<script type='text/javascript'>alert('OK');</script>");
            xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
        //    xmpp.OnError += new ErrorHandler(xmpp_OnError);  
        }

        protected void cmdLogin_Click(object sender, EventArgs e)
        {
            //xmpp = (XmppClientConnection)Application["xmpp"];
            //if (xmpp == null)
            //{
            //    xmpp = new XmppClientConnection();
            //    Application["xmpp"] = xmpp;                
            //}

            xmpp.AutoPresence                        = true;
            xmpp.AutoResolveConnectServer   = true;
            xmpp.Port                                        = 5222;           
            xmpp.UseSSL                                   = false;
            xmpp.Server                                    = "example.com";
            xmpp.Username                             = "admin";
            xmpp.Password                              = "admin";
            xmpp.Priority = 10;
            xmpp.UseCompression = false;
            xmpp.EnableCapabilities = true;
            xmpp.ClientVersion = "1.0";
            xmpp.Resource = "WebClient";
            xmpp.Open();
          //  Response.Write("<script type='text/javascript'>alert('OK');</script>");
        }

        void xmpp_OnLogin(object sender)
        {
            Response.Write("<script type='text/javascript'>alert('OK');</script>");
        }

myselfnow的主页 myselfnow | 菜鸟二级 | 园豆:208
提问于:2014-06-11 09:36
< >
分享
所有回答(1)
0

 您好,请问这个问题您解决了么 我现在用xmpp 也遇到了这个问题了。。。好悲剧 没反应。。。

徵羽 | 园豆:202 (菜鸟二级) | 2015-03-18 21:45
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册