Close tcp out node more forcibly. (and update status) on redeploy.

This commit is contained in:
Dave Conway-Jones 2015-12-07 17:41:51 +00:00
parent dda90f956d
commit 1280e5bc8b
1 changed files with 3 additions and 1 deletions

View File

@ -242,6 +242,8 @@ module.exports = function(RED) {
node.log(RED._("tcpin.errors.error",{error:err.toString()}));
});
client.on('end', function (err) {
node.status({});
node.connected = false;
});
client.on('close', function() {
node.status({fill:"red",shape:"ring",text:"common.status.disconnected"});
@ -282,7 +284,7 @@ module.exports = function(RED) {
node.on("close", function(done) {
node.done = done;
this.closing = true;
if (client) { client.end(); }
if (client) { client.destroy(); }
clearTimeout(reconnectTimeout);
if (!node.connected) { done(); }
});