Not logged in. · Lost password · Register
Forum: agsXMPP RSS
jaecen #1
Member since Dec 2009 · 2 posts · Location: Fairfax, VA
Group memberships: Members
Show profile · Link to this post
Subject: Trouble getting started...
I am working with an XMPP solution, and am just getting started.

I have setup an ejabberd server on my local machine, with a virtual host at Using Psi, I can easily connect to and disco my server. In contrast, with agsXMPP, I can never seem to get connected to my local machine (remote machines seem to connect OK). OnLogin never fires, and, unfortunately, I can't get OnError or OnAuthError to fire.

I have toggled IPv6 on my machine, as well as adjusting the registry settings for IPv6, in an attempt to track this down.

I can't AutoResolve, as that (even in Psi), I have to specify the ConnectServer value; otherwise, if it tried to resolve to, it's just going to error "Unable to find host", etc. 

What I've thrown together is pretty much the textbook example of how this should work correctly, and, since both Psi and Pidgen can connect to my server, I would believe there is something I have incorrect in my code. Could you point me in the right direction?




OK... somehow I completely missed the OnSocketError handler. >.<

So, since my local machine is Vista, should I assume that this is definitely an IPv4 vs IPv6 issue, or are there other items I should check as well?

"No connection could be made because the target machine actively refused it ::1:5222"

        private void button_Click(object sender, EventArgs e)

            XmppClientConnection xmppCon = new XmppClientConnection();

            Jid jid = new Jid("");

            xmppCon.Password = "foo";
            xmppCon.Username = jid.User;
            xmppCon.Server = jid.Server;
            xmppCon.Port = 5222;
            xmppCon.ConnectServer = "x.x.x.x"; //IP Address of localhost

            xmppCon.AutoAgents = false;
            xmppCon.AutoPresence = true;
            xmppCon.AutoRoster = true;
            //xmppCon.AutoResolveConnectServer = true;

                xmppCon.OnRosterStart += new ObjectHandler(xmppCon_OnRosterStart);
                xmppCon.OnRosterItem += new XmppClientConnection.RosterHandler(xmppCon_OnRosterItem);
                xmppCon.OnRosterEnd += new ObjectHandler(xmppCon_OnRosterEnd);
                xmppCon.OnPresence += new PresenceHandler(xmppCon_OnPresence);
                xmppCon.OnMessage += new MessageHandler(xmppCon_OnMessage);
                xmppCon.OnLogin += new ObjectHandler(xmppCon_OnLogin);

                xmppCon.OnReadXml += new XmlHandler(xmppCon_OnReadXML);
                xmppCon.OnWriteXml += new XmlHandler(xmppCon_OnWriteXML);

                xmppCon.OnAuthError += new XmppElementHandler(xmppCon_OnAuthError);
                xmppCon.OnError += new ErrorHandler(xmppCon_OnError);

            catch (Exception exc)

            Wait("Login to server, please wait");

        private static void Wait(string statusMessage)
            int i = 0;
            _bWait = true;

            while (_bWait)
                if (i == 60)
                    _bWait = false;

This post was edited on 2010-01-04, 23:30 by jaecen.
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you said you configured ejabberd to the xmpp domain
Try to add a entry in the hostfile for with the ipv4 address of your server.
You can also set AutoresolveConnectServer to false and specify the ipv4 address in the ConnectServer property.

jaecen #3
Member since Dec 2009 · 2 posts · Location: Fairfax, VA
Group memberships: Members
Show profile · Link to this post
That was it. By modifying the file at C:\WINDOWS\system32\drivers\etc\hosts to include my IPv4 address and server name, this worked immediately.

A lot of work ahead of me, but at least I can stop chasing my tail.

Thanks for the help Alex!
ahoffman #4
Member since May 2011 · 10 posts
Group memberships: Members
Show profile · Link to this post
This seems related to the problem that I am having. Same symptoms, only trouble connecting on local box.

I'll give this a shot tomorrow. :)
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