You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
I'm using this library to connect to HipChat and also encountered that the connection gets closed by the server after a while.
I checked how the Hubot hipchat adapter (which also uses xmpp) tackles this, as I knew that one does not suffer from this issue, and that one seems to send a "r" Stanza in regular time intervals (each 30 seconds).
Based on the hubot example, I've implemented this in my own app, which seems to solve the connection drops by the server:
var keepAlive;
var ping = function () {
xmpp.conn.send(new Client.Stanza('r'));
};
xmpp.on('online', function(data) {
keepAlive = setInterval(ping, 30000);
});
xmpp.on('close', function() {
if (keepAlive) {
clearInterval(keepAlive);
}
});
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After connected, it will automatically exit with code 0 after a little while (like 3 minutes)
The text was updated successfully, but these errors were encountered: