Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Ratnam #1
Member since Sep 2015 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: agsXMPP OnLogin event not firing in windows application
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:

  1. JID_Sender = jid.Text;
  2. password = pword.Text;
  3. MessageBox.Show("The jid is:" + JID_Sender);
  4. MessageBox.Show("The password is:" + password);
  5.  
  6. Jid jidSender = new Jid(JID_Sender);
  7. XmppClientConnection xmpp = new XmppClientConnection(jidSender.Server);
  8. try
  9. {
  10.  
  11.   xmpp.Open(jidSender.User, password);
  12.   xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
  13.  
  14. }
  15. catch (Exception k)
  16. {
  17.     MessageBox.Show(k.Message);
  18. }
  19. MessageBox.Show("waiting for login...1");
  20. info.Text = "Wait for Login ";
  21. MessageBox.Show("waiting for login...2");
  22.  
  23.  
  24. int i = 0;
  25. _wait = true;
  26. do
  27. {
  28.     info.Text += ".";
  29.     i++;
  30.     if (i == 10)
  31.         _wait = false;
  32.     Thread.Sleep(500);
  33. } while (_wait);
  34. info.Clear();

Please help me.
This post was edited on 2015-09-11, 20:06 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
have you looked at the MiniClient example? Its a complete chat client example.
If your code works in a console app then I seeno reason why it should not work in Windows Forms application.

Alex
Avatar
Ratnam #3
Member since Sep 2015 · 4 posts
Group memberships: Members
Show profile · Link to this post
same code in windows form app not working. Is there anything wrong in my code?
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I see nothing wrong, but your code is  not complete. OnLogin hander code is missing for example.
Also add the XML logging handler and post your XML log here please.

Alex
Avatar
Ratnam #5
Member since Sep 2015 · 4 posts
Group memberships: Members
Show profile · Link to this post
thanks for your reply. I have all the event in my code. my code is connecting server. but know problem is its not Handles incoming messages, MessageCallBack not working.
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Have you looked at the MiniClient example as I suggested?
Avatar
Ratnam #7
Member since Sep 2015 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to generate Xmpp packets from web.
I am developing chat appli openfire server xmpp using jabber.net client. Its working fine. then how to send packets to XMPP server
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS