1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

make sure stomp client calls done on close.

This commit is contained in:
dceejay 2015-04-17 21:06:27 +01:00
parent 31318b03d7
commit 97d271be2c
2 changed files with 9 additions and 6 deletions

View File

@ -90,12 +90,11 @@ module.exports = function(RED) {
node.on("close", function(done) {
closing = true;
if (node.client) {
node.client.on("disconnect", function() {
done();
});
node.client.on("disconnect", function() { done(); });
//node.client.unsubscribe(node.topic);
node.client.disconnect();
} else { done(); }
}
else { done(); }
});
}
RED.nodes.registerType("stomp in",StompInNode);
@ -143,7 +142,11 @@ module.exports = function(RED) {
node.on("close", function(done) {
closing = true;
if (client) { client.disconnect(); }
if (node.client) {
node.client.on("disconnect", function() { done(); });
node.client.disconnect();
}
else { done(); }
});
}
RED.nodes.registerType("stomp out",StompOutNode);

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-stomp",
"version" : "0.0.3",
"version" : "0.0.4",
"description" : "A Node-RED node to publish and subscribe to/from a Stomp server",
"dependencies" : {
"stomp-client" : "0.6.2"