-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no callback called when xmpp server down #3
Comments
If the server isn't there then it can't respond with an error response. Or are you in the situation where the server is up and you are connected but the server isn't responding to pings? |
Didn't receive the I am writing an admin bot in a node.js app to communicate with my ejabberd xmpp server. The xmpp server is not trustable and it restarts frequently. These admin tasks are very important, so I have to make sure that there is an active connection before making the calls. For this I want to use I am also open to an alternative solution, if you can suggest something. |
Ahh ok. When the XMPP server dies it should inform clients and this will be passed down as an Maybe you aren't seeing either of these events? If there's more for discussing I'm happy to set up a chat to help you sort out your issues here. I've also created https://github.com/lloydwatkin/xmpp-command-bot if that's of any use? |
Most likely this isn't happening, I'll need to check.
Exactly. Its a node.js server, which is also a backend api for a mobile app.
This would be great. Let me know how you want to do this.
Looks interesting, right now I am handling all the tasks via xmpp calls with admin user. But this would also mean that the node app should be running on the same instance as the xmpp server, which may not be very comfortable. |
The command bot can live anywhere, you can make command requests to a remote server using ssh. But anyway feel free to IM me at lloyd@evilprofessor.co.uk and we'll chat through your issues. |
How have you implemented your server side socket (the one you give to |
I am using the one given on the wiki page - var Socket = function() {
this.server = new Emitter();
this.client = new Emitter();
var self = this;
this.server.send = function(event, data, rsm, callback) {
self.client.emit(event, data, rsm, callback);
};
this.client.send = function(event, data, callback) {
self.server.emit(event, data, callback);
};
};
Socket.prototype.on = function(event, data, rsm) {
this.server.on(event, data, rsm);
};
Socket.prototype.send = function(event, data, callback) {
this.server.send(event, data, callback);
};
Socket.prototype.removeAllListeners = function(event) {
this.server.removeAllListeners(event);
};
Socket.prototype.end = function() {
this.server.emit('end', 'connection closed', function() {});
};
var socket = new Socket(); added the |
Could you just add a |
Tried with the |
Okay. I got a workaround for this. Posting it here for anyone who comes searching for a solution. xmppClient.client.once('offline', function(data) {
console.log("disconnected");
// reconnect logic goes here
}); where |
Leaving the issue open since the original problem is still not solved - no callback is called when xmpp server is down. Here are my views on this.
@lloydwatkin Please close the issue if you feel differently. |
Actually this should be incorporated into |
@shobhitsinghal624 the first part of this is fixed and pushed as |
Thanks @lloydwatkin . Just tested the new version, works as expected except for the stack overload issue for which I have raised a small PR - xmpp-ftw/xmpp-ftw#79 |
Thanks for the PR, now merged and published, I'll get on with a method to report the lack of a connection in the next few days. |
I am stuck in the case when there is no reply from the xmpp server, as the callback is never called.
Here is what I get on
console.log(client.tracking);
Shouldn't the callback be called with a no-response error. Or is there another way to handle no response from the xmpp server.
The text was updated successfully, but these errors were encountered: