Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
jullius cezars #1
Member since Aug 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: MatriX with Openfire not return erros ou log
I'm trying connect in Openfire, but not return erros or messages in log.

  1. protected override void OnCreate(Bundle bundle)
  2.         {
  3.             base.OnCreate(bundle);
  4.  
  5.             // Set our view from the "main" layout resource
  6.             SetContentView(Resource.Layout.Main);
  7.    
  8.  
  9.             Login();
  10.         }

  1. XmppClient _cliente = new XmppClient();
  2.  
  3.         public void Login()
  4.         {           
  5.             try
  6.             {
  7.                 _cliente.SetUsername("android@julio-pc");
  8.                 _cliente.Password = "android";
  9.                 _cliente.SetXmppDomain("192.168.0.42");
  10.                 _cliente.Port = 5222;
  11.                 _cliente.Status = "I can chat";
  12.                 _cliente.Show = Matrix.Xmpp.Show.chat;
  13.                 _cliente.AutoRoster = true;
  14.                 _cliente.AutoPresence = true;
  15.                
  16.                 _cliente.OnLogin += new EventHandler<Matrix.EventArgs>(xmppClient_OnLogin);
  17.                
  18.                 _cliente.OnReceiveXml += new EventHandler<TextEventArgs>(XmppClientOnReceiveXml);
  19.                
  20.                 _cliente.OnSendXml += new EventHandler<TextEventArgs>(XmppClientOnSendXml);
  21.  
  22.                 _cliente.Open();
  23.             }
  24.             catch (Exception ex)
  25.             {
  26.  
  27.                 Console.WriteLine(ex.Message);
  28.  
  29.             }
  30.         }
  31.  
  32.         void XmppClientOnSendXml(object sender, TextEventArgs e)
  33.         {
  34.             AddDebug("SEND: " + e.Text);
  35.         }
  36.  
  37.         void XmppClientOnReceiveXml(object sender, TextEventArgs e)
  38.         {
  39.             AddDebug("RECV: " + e.Text);
  40.         }
  41.  
  42.         void AddDebug(string debug)
  43.         {
  44.             Console.WriteLine(debug);
  45.         }
This post was edited on 2014-08-04, 22:09 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
1) Subscribe to the OnError event. This will tell you whats going wrong
2) never use IP addresses as XMPP domain. I am pretty sure that you XMPP domain is wrong. When you install a new server its never an IP address but the workstation name.
3) username normally does not have an @. If your XMPP domain is julio-pc then the username is android, and not android@julio-pc. And I guess your XMPP domain is julio-pc and not 192.168.0.42

I guess your connection properties should look like:

  1. _cliente.SetUsername("android");
  2. _cliente.Password = "android";
  3. _cliente.SetXmppDomain("julio-pc");
  4. _cliente.Hostname("192.168.0.42");
  5. _cliente.Port = 5222;
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: MatriX RSS