Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
RoundSparrow #1
Member since Mar 2005 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Simple client application to work with 0.26
Hi,

It took me a while to get a working signin, so posting my code here...

                Console.WriteLine("jabber.org server...");
                XmppClientConnection xmpp = new XmppClientConnection("jabber.org");
                xmpp.UseSSL = true;
                xmpp.Port = 5223;   // SSL port = 5223
                xmpp.Open("testaccount001", "password001");
                Console.WriteLine("After Open...");
                System.Threading.Thread.Sleep(8000);
                xmpp.Status = "Online";
                // showtype.online not in library?  Seems to be default if you don't set.
                xmpp.Show = agsXMPP.protocol.ShowType.chat;
                xmpp.SendMyPresence();
                Console.WriteLine("After Presence...");
                System.Threading.Thread.Sleep(5000);

                xmpp.Send( new agsXMPP.protocol.Message("roundsparrow@jabber.org", MessageType.chat, "agsXMPP - Hello, how are you?"));
Avatar
RoundSparrow #2
Member since Mar 2005 · 3 posts
Group memberships: Members
Show profile · Link to this post
jabber.org seems to only work with ssl right now, I can not seem to get a non-ssl login to work.
Avatar
Alex #3
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by "RoundSparrow":
jabber.org seems to only work with ssl right now, I can not seem to get a non-ssl login to work.

i have no problems to login to jabber.org with and without SSL.
There was a problem with some jabberd2 servers. They send the IQ, Message and presence with the jabber:client namespace like:

<iq xmlns="jabber:client" from="me" to="you" id="myid"><query xmlns="somequery"/></iq>

so registering them in the ElementFactory fixes that.

I added this :
AddElementType(&quot;iq&quot;,        Uri.CLIENT,    typeof(agsXMPP.protocol.Iq));
AddElementType(&quot;message&quot;,    Uri.CLIENT,    typeof(agsXMPP.protocol.Message));
AddElementType(&quot;presence&quot;,    Uri.CLIENT,    typeof(agsXMPP.protocol.Presence));

this will be in the next release.

Alex
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