Subject: Matrix for .net - minimal required code for connecting to e.g. Openfire
Hi Alex,
I tried to connect to my local Openfire server (standard config. and one additional user "maltin").
It seems that I can't connect (Openfire shows no active user in the admin console).
I used the example from Silvelight with minimal changes.
Here is the used code snippet:
XmppClient xmppClient = new XmppClient();
xmppClient.Username = textBoxUsername.Text; //e.g. maltin
xmppClient.Password = textBoxPassword.Text; //e.g. secret
xmppClient.XmppDomain = textBoxDomain.Text; //e.g. maltin@jabber.server.de
if (!String.IsNullOrEmpty(textBoxHostname.Text)) //e.g. jabber.server.de
xmppClient.Hostname = textBoxHostname.Text;
xmppClient.Port = 5222;
xmppClient.Priority = 100;
// mppClient.ProxyHostname = "localhost";
// xmppClient.ProxyPort = 4503;
xmppClient.AutoPresence = false;
xmppClient.Priority = 1;
xmppClient.Status = "online";
xmppClient.Show = Matrix.Xmpp.Show.NONE;
xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.None;
// xmppClient.OnError += new EventHandler<Matrix.ExceptionEventArgs>(xmppClient_OnError);
// xmppClient.OnLogin += new EventHandler<Matrix.EventArgs>(xmppClient_OnLogin);
// xmppClient.OnAuthError += new EventHandler<Matrix.Xmpp.Sasl.SaslEventArgs>(xmppClient_OnAuthError);
xmppClient.Open();
After open I would assume to see the active user in openfire.
1. What's wrong with my code (I used your lib MatriX .net not Silverlight)?
2. How can I check if I'm connected to the server ?
Thank you for giving me a hint.
Martin
I tried to connect to my local Openfire server (standard config. and one additional user "maltin").
It seems that I can't connect (Openfire shows no active user in the admin console).
I used the example from Silvelight with minimal changes.
Here is the used code snippet:
XmppClient xmppClient = new XmppClient();
xmppClient.Username = textBoxUsername.Text; //e.g. maltin
xmppClient.Password = textBoxPassword.Text; //e.g. secret
xmppClient.XmppDomain = textBoxDomain.Text; //e.g. maltin@jabber.server.de
if (!String.IsNullOrEmpty(textBoxHostname.Text)) //e.g. jabber.server.de
xmppClient.Hostname = textBoxHostname.Text;
xmppClient.Port = 5222;
xmppClient.Priority = 100;
// mppClient.ProxyHostname = "localhost";
// xmppClient.ProxyPort = 4503;
xmppClient.AutoPresence = false;
xmppClient.Priority = 1;
xmppClient.Status = "online";
xmppClient.Show = Matrix.Xmpp.Show.NONE;
xmppClient.ProxyType = Matrix.Net.Proxy.ProxyType.None;
// xmppClient.OnError += new EventHandler<Matrix.ExceptionEventArgs>(xmppClient_OnError);
// xmppClient.OnLogin += new EventHandler<Matrix.EventArgs>(xmppClient_OnLogin);
// xmppClient.OnAuthError += new EventHandler<Matrix.Xmpp.Sasl.SaslEventArgs>(xmppClient_OnAuthError);
xmppClient.Open();
After open I would assume to see the active user in openfire.
1. What's wrong with my code (I used your lib MatriX .net not Silverlight)?
2. How can I check if I'm connected to the server ?
Thank you for giving me a hint.
Martin