Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
kissag99 #1
Member since Oct 2011 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Client disconnects when an IQ packet is sent
I am writing a client application using agsXMPP SDK. Login to openfire is successful.

When I send an custom IQ to server component, the client session gets disconnected.

 private void btnOpenConnection_Click(object sender, EventArgs e)
        {
            Jid jidSender = new Jid(cmbLogonAs.SelectedItem.ToString());
           
            xmppClient = new XmppClientConnection(jidSender.Server);

            xmppClient.OnAuthError += new XmppElementHandler(xmppClient_OnAuthError);
            xmppClient.OnError += new ErrorHandler(xmppClient_OnError);
            xmppClient.OnRosterEnd += new ObjectHandler(xmppClient_OnRosterEnd);
            xmppClient.OnClose += new ObjectHandler(xmppClient_OnClose);
            xmppClient.OnMessage += new agsXMPP.protocol.client.MessageHandler(xmppClient_OnMessage);
            xmppClient.OnLogin += new ObjectHandler(xmppClient_OnLogin);
            xmppClient.OnIq += new IqHandler(xmppClient_OnIq);
            //xmppClient.IqGrabber += new IqGrabber(xmppClient_IqGrabber);
            xmppClient.Open(jidSender.User, PASSWORD);

        }

         private void getProfilesBtn_Click(object sender, EventArgs e)
        {
            MyIQ gps = new MyIQ(new Jid(userUri));
            gps.Id = "369";
            gps.From = xmppClient.MyJID;
            gps.To = "mycomp.local";
            MessageBox.Show(gps.ToString());
            xmppClient.Send(gps);
        }

I thought IQ without an id will be rejected by openfire, so I tried setting an id to IQ packet I send.

When I send this packet server logs show  the session for user is disocnnected.

I am stuck at this moment unable to figure out the problem.

Regards,
Kissag
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post your Debug Xml, there is probably the reason for the disconnect.
Avatar
kissag99 #3
Member since Oct 2011 · 3 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

When I try to login, the first IQ I receive is as follows.

Packet <iq xmlns="jabber:client" to="1291@btc.local/agsXMPP" id="agsXMPP_3" type="error" from="btc.local"><query xmlns="jabber:iq:agents" /><error type="cancel" code="501"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

Regards,
Kissag
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I need the debug of the complete session.

Alex
Avatar
kissag99 #5
Member since Oct 2011 · 3 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Hi Alex,

Found the issue I was mal-forming the IQ packet. Openfire drops the connection if a client sends a mal-formed.

Regards,
Sagar
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