Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
vbguru613 #1
Member since May 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: windows mobile - events not firing nor is my status getting updated.
//Windows Mobile 5.0 - 6.0 // Compact framework 2.0 VS2008
//Events subscribing to

            xmppCon.OnError += new ErrorHandler(xmppCon_OnError);
            xmppCon.OnAuthError += new XmppElementHandler(xmppCon_OnAuthError);
            xmppCon.OnIq += new agsXMPP.protocol.client.IqHandler(xmppCon_OnIq);
            xmppCon.OnMessage += new agsXMPP.protocol.client.MessageHandler(xmppCon_OnMessage);
            xmppCon.OnLogin += new ObjectHandler(xmppCon_OnLogin);
            xmppCon.KeepAlive = true;
//Here is my Login Code

btnLogin.Enabled = false;
                    Jid jidUser = new Jid(txtUserName.Text + "@gmail.com");
                    xmppCon.Username = jidUser.User;
                    xmppCon.Server = "gmail.com";
                    xmppCon.ConnectServer = "talk.google.com";
                    xmppCon.Priority = 10;
                    xmppCon.Port = 5223; //It hangs when I use 5222
                    xmppCon.AutoRoster = true;
                    xmppCon.AutoPresence = true;
                    xmppCon.Password = txtPassword.Text;
                    xmppCon.UseCompression = true;
                    xmppCon.AutoResolveConnectServer = false;
                    xmppCon.SocketConnectionType = agsXMPP.net.SocketConnectionType.Direct;
                    xmppCon.UseStartTLS = false;
                    xmppCon.Open();


//Send Status Code

 string nodeStr = string.Format("<iq type='set' ><query xmlns='google:shared-status' status-min-ver='1'><status>{0}</status><show>default</show><invisible value='false' /></query></iq>", status);
                    xmppCon.Send(nodeStr); 

thank You
Avatar
Alex #2
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • please post your Xml log. You get the Xml Log from  the events OnReadXml and OnWriteXml.
  • you must use port 5222.
  • remove xmppCon.Send(nodeStr); you can't send any Xml before you are connected, and the Open method is async.

Alex
Avatar
vbguru613 #3
Member since May 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
when I use port 5222 it the xmpp stays in a Connecting... State.

I dont send the nodestr until I am connected

                    xmppCon.Open();
                   
                    int timePassed = 0;

                    while (xmppCon.XmppConnectionState == XmppConnectionState.Connecting && LOGIN_CANCEL == false)
                    {
                        lblStatus.Text = string.Format("Connecting...({0})", timePassed);
                        lblStatus.Refresh();
                        System.Threading.Thread.Sleep(1000);
                        timePassed += 1;
                        if (timePassed > 15)
                        {
                            LOGIN_CANCEL = true;
                        }
                    }
Avatar
vbguru613 #4
Member since May 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
debug.txt

<stream:stream to='gmail.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'><stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="gmail.com" version="1.0" id="3F7A66245C090B69" ><stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-GOOGLE-TOKEN</mechanism></mechanisms></stream:features>
Avatar
Alex #5
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Can you please checkout the latest code from SVN or download the binary for CF from here:
http://www.ag-software.net/index.php?page=downloads

Some weeks ago I made some changes for Google XToken SASL mechanism.

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