Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

<error code="500" type="wait"><resource-constraint> in presence #15

Closed
Daniel15 opened this issue Apr 3, 2013 · 2 comments
Closed

<error code="500" type="wait"><resource-constraint> in presence #15

Daniel15 opened this issue Apr 3, 2013 · 2 comments

Comments

@Daniel15
Copy link
Contributor

Daniel15 commented Apr 3, 2013

I've created a simple XMPP bot that connects to XMPP and sits quietly watching for status changes. Sometimes, instead of correct presence information, I get this:

<presence from="example@gmail.com" to="me@jabber.org/0fcabd76270901f9" type="error" xmlns:stream="http://etherx.jabber.org/streams">
    <error code="500" type="wait">
        <resource-constraint xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    </error>
</presence>

How do I solve this?

@Daniel15
Copy link
Contributor Author

Daniel15 commented Apr 3, 2013

I'm going to remove this to see if it helps:

//make the connection live
setInterval(function() {
   conn.send(new xmpp.Element('presence'));
}, 1000 * 10)

Why is this in the code? It looks a bit odd - I've sniffed traffic from my XMPP client and looked at other examples and I haven't seen any others that send a <presence /> stanza every 10 seconds (my client only seems to do it when I change status).

Daniel15 added a commit to Daniel15/node-simple-xmpp that referenced this issue Apr 3, 2013
Sending <presence> stanzas too frequently may cause issues with servers rate limiting the user (see issue simple-xmpp#15). This switches to using whitespace for keepalives instead. 

From XMPP specs:

   One common method for checking the TCP connection is to send a space
   character (U+0020) between XML stanzas, which is allowed for XML
   streams as described under Section 11.7; the sending of such a space
   character is properly called a "whitespace keepalive" (the term
   "whitespace ping" is often used, despite the fact that it is not a
   ping since no "pong" is possible).
@Daniel15
Copy link
Contributor Author

Daniel15 commented May 2, 2013

This can be closed as #17 should fix it.

@Daniel15 Daniel15 closed this as completed May 2, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant