agsXMPP OnLogin event not firing in windows application

158 Views Asked by At

I am trying to make an agsXMPP jabber chat client in window app. but the OnLogin event is not firing at all. In console app its working fine. but windows or web its not working.

Here is the code:

      JID_Sender = jid.Text;
        password = pword.Text;
        MessageBox.Show("The jid is:" + JID_Sender);
        MessageBox.Show("The password is:" + password);

        Jid jidSender = new Jid(JID_Sender);
        XmppClientConnection xmpp = new XmppClientConnection(jidSender.Server);
        try
        {

          xmpp.Open(jidSender.User, password);
          xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);

        }
        catch (Exception k)
        {
            MessageBox.Show(k.Message);
        }
        MessageBox.Show("waiting for login...1");
        info.Text = "Wait for Login ";
        MessageBox.Show("waiting for login...2");


        int i = 0;
        _wait = true;
        do
        {
            info.Text += ".";
            i++;
            if (i == 10)
                _wait = false;
            Thread.Sleep(500);
        } while (_wait);
        info.Clear();

Please help me.

0

There are 0 best solutions below