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 having a problem with a program I wrote not reconnecting in the event of a problem. The program handles other stuff as well as XMPP, so when the XMPP connection dies, the program itself stays alive. I'd like to prevent this scenario from occurring, so that XMPP reconnects on its own if there's a problem. Am I missing a line of code or anything to auto handle connection issues?
I'm having a problem with a program I wrote not reconnecting in the event of a problem. The program handles other stuff as well as XMPP, so when the XMPP connection dies, the program itself stays alive. I'd like to prevent this scenario from occurring, so that XMPP reconnects on its own if there's a problem. Am I missing a line of code or anything to auto handle connection issues?
Code:
xmpp.on('online', function(data) {
console.log('Yes, I'm connected!');
console.log(xmpp.conn);
});
xmpp.on('error', function(err) {
console.error(err);
});
xmpp.connect({
jid : '[email protected]',
password : 'XXXXXXXX',
host : 'talk.google.com',
port : 5222
});
xmpp.subscribe('[email protected]');
xmpp.getRoster();
The last thing I saw before it died (from console.log(err)):
{ name: 'stream:error',
parent: null,
attrs: { 'xmlns:stream': 'http://etherx.jabber.org/streams' },
children:
[ { name: 'see-other-host',
parent: [Circular],
attrs: [Object],
children: [] },
{ name: 'str:text',
parent: [Circular],
attrs: [Object],
children: [Object] } ] }
The text was updated successfully, but these errors were encountered: